This function returns a string containing the substring of the input string determined by the starting index and count of characters. AngelScript signature: string string::substr(uint start = 0, int count = -1) const
| 956 | // AngelScript signature: |
| 957 | // string string::substr(uint start = 0, int count = -1) const |
| 958 | static string StringSubString(asUINT start, int count, const string &str) |
| 959 | { |
| 960 | // Check for out-of-bounds |
| 961 | string ret; |
| 962 | if( start < str.length() && count != 0 ) |
| 963 | ret = str.substr(start, (size_t)(count < 0 ? string::npos : count)); |
| 964 | |
| 965 | return ret; |
| 966 | } |
| 967 | |
| 968 | // String equality comparison. |
| 969 | // Returns true iff lhs is equal to rhs. |
no test coverage detected