Stay organized with collections
Save and categorize content based on your preferences.
SimpleStringSplitter
open class SimpleStringSplitter : MutableIterator<String!>, TextUtils.StringSplitter
A simple string splitter.
If the final character in the string to split is the delimiter then no empty string will be returned for the empty string after that delimeter. That is, splitting "a,b," on comma will return "a", "b", not "a", "b", "".
Summary
Public constructors |
Initializes the splitter.
|
Public constructors
SimpleStringSplitter
SimpleStringSplitter(delimiter: Char)
Initializes the splitter. setString may be called later.
Parameters |
delimiter |
Char: the delimeter on which to split |
Public methods
hasNext
open fun hasNext(): Boolean
Return |
Boolean |
true if the iteration has more elements |
next
open fun next(): String!
Return |
String! |
the next element in the iteration |
Exceptions |
java.util.NoSuchElementException |
if the iteration has no more elements |
remove
open fun remove(): Unit
Exceptions |
java.lang.UnsupportedOperationException |
if the remove operation is not supported by this iterator |
java.lang.IllegalStateException |
if the next method has not yet been called, or the remove method has already been called after the last call to the next method |
setString
open fun setString(string: String!): Unit
Sets the string to split
Parameters |
string |
String!: the string to split |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[]]