* Returns the first token in the IString. A token is defined as a string of * characters from the beginning of the string to, but not including, the first * character matching any character in the separator string. The token is * removed from the original string along with the separator. * * @deprecated * * @param separator The string of characters used to separate tokens. The
| 896 | * @return IString |
| 897 | */ |
| 898 | IString IString::Token(const IString &separator) { |
| 899 | IString retstr = "" ; |
| 900 | |
| 901 | for(unsigned int i = 0; i < size(); i++) { |
| 902 | for(unsigned int sep = 0; sep < separator.size(); sep++) { |
| 903 | if(separator[sep] == at(i)) { |
| 904 | retstr = substr(0, i); |
| 905 | replace(0, i + 1, ""); |
| 906 | return retstr; |
| 907 | } |
| 908 | } |
| 909 | } |
| 910 | |
| 911 | if(retstr == "") { |
| 912 | retstr = (*this); |
| 913 | replace(0, size(), ""); |
| 914 | } |
| 915 | |
| 916 | return retstr; |
| 917 | } |
| 918 | |
| 919 | /** |
| 920 | * @brief Find separators between characters and split them into strings |