MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / substring

Method substring

src/String.cpp:2146–2168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2144}
2145
2146String String::substring(int startIndex, Dynamic inEndIndex) const
2147{
2148 int endIndex = inEndIndex == null() ? length : inEndIndex->__ToInt();
2149 if ( endIndex < 0 ) {
2150 endIndex = 0;
2151 } else if ( endIndex > length ) {
2152 endIndex = length;
2153 }
2154
2155 if ( startIndex < 0 ) {
2156 startIndex = 0;
2157 } else if ( startIndex > length ) {
2158 startIndex = length;
2159 }
2160
2161 if ( startIndex > endIndex ) {
2162 int tmp = startIndex;
2163 startIndex = endIndex;
2164 endIndex = tmp;
2165 }
2166
2167 return substr( startIndex, endIndex - startIndex );
2168}
2169
2170String String::operator+(const String &inRHS) const
2171{

Callers 2

runStringMethod · 0.80
runSubstringMethod · 0.80

Calls 2

nullClass · 0.50
__ToIntMethod · 0.45

Tested by

no test coverage detected