@NotThreadSafe public class StringScanner extends Object implements Serializable
Constructor and Description |
---|
StringScanner(String sInput) |
Modifier and Type | Method and Description |
---|---|
int |
findFirstIndex(char... aChars) |
char |
getCharAtIndex(int nIndex) |
char |
getCurrentChar() |
int |
getCurrentIndex() |
int |
getRemainingChars() |
String |
getRest()
Get all remaining chars, and set the index to the end of the input string
|
String |
getUntil(char cEndExcl)
Get the string until the specified end character, but excluding the end
character.
|
String |
getUntilBalanced(int nStartLevel,
char cOpenChar,
char cCloseChar) |
String |
getUntilIndex(int nEndIndex) |
String |
getUntilWhiteSpace() |
boolean |
isCurrentChar(char c) |
StringScanner |
setIndex(int nIndex) |
StringScanner |
skip(int nCount) |
StringScanner |
skipbackWhitespaces() |
StringScanner |
skipWhitespaces() |
String |
toString() |
@Nonnegative public int getCurrentIndex()
@Nonnegative public int getRemainingChars()
@Nonnull public StringScanner skipWhitespaces()
@Nonnull public StringScanner skipbackWhitespaces()
@Nonnull public StringScanner skip(int nCount)
public int findFirstIndex(@Nonnull char... aChars)
public char getCharAtIndex(int nIndex)
public char getCurrentChar()
public boolean isCurrentChar(char c)
@Nonnull public StringScanner setIndex(@Nonnegative int nIndex)
@Nonnull public String getRest()
null
but may be
empty.@Nonnull public String getUntil(char cEndExcl)
cEndExcl
- The end character to search.null
string with all characters from the current
index until the end character, but not including the end character.@Nonnull public String getUntilBalanced(int nStartLevel, char cOpenChar, char cCloseChar)
Copyright © 2014–2019 Philip Helger. All rights reserved.