public class CursoredString
extends java.lang.Object
This class has a notion of consuming and remainder. Characters are consumed from the beginning of the string towards the end and whatever has not been consumed is the remainder.
Modifier and Type | Field and Description |
---|---|
java.lang.String |
_s |
Constructor and Description |
---|
CursoredString(java.lang.String s) |
Modifier and Type | Method and Description |
---|---|
char |
consume() |
boolean |
finished() |
boolean |
startsWith(char... prefixes) |
boolean |
startsWith(char prefix,
boolean consume) |
boolean |
startsWith(java.lang.String prefix,
boolean consume)
Determines whether the remainder of the string starts with a particular prefix.
|
public boolean startsWith(java.lang.String prefix, boolean consume)
prefix
- The prefix to checkconsume
- Whether to consume the prefixpublic boolean startsWith(char prefix, boolean consume)
public boolean startsWith(char... prefixes)
public char consume()
public boolean finished()