Package com.helger.commons.string.util
Class StringScanner
java.lang.Object
com.helger.commons.string.util.StringScanner
Simple string scanner.
- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintfindFirstIndex(char... aChars) chargetCharAtIndex(int nIndex) charintintgetRest()Get all remaining chars, and set the index to the end of the input stringgetUntil(char cEndExcl) Get the string until the specified end character, but excluding the end character.getUntilBalanced(int nStartLevel, char cOpenChar, char cCloseChar) getUntilIndex(int nEndIndex) booleanisCurrentChar(char c) setIndex(int nIndex) skip(int nCount) toString()
-
Constructor Details
-
StringScanner
-
-
Method Details
-
getCurrentIndex
-
getRemainingChars
-
skipWhitespaces
-
skipbackWhitespaces
-
skip
-
findFirstIndex
-
getCharAtIndex
public char getCharAtIndex(int nIndex) -
getCurrentChar
public char getCurrentChar() -
isCurrentChar
public boolean isCurrentChar(char c) -
setIndex
-
getRest
Get all remaining chars, and set the index to the end of the input string- Returns:
- The remaining string. May not be
nullbut may be empty.
-
getUntilIndex
-
getUntilWhiteSpace
-
getUntil
Get the string until the specified end character, but excluding the end character.- Parameters:
cEndExcl- The end character to search.- Returns:
- A non-
nullstring with all characters from the current index until the end character, but not including the end character.
-
getUntilBalanced
-
toString
-