Skip to content

Most visited

Recently visited

navigation
Added in API level 1

TextUtils.SimpleStringSplitter

public static class TextUtils.SimpleStringSplitter
extends Object implements TextUtils.StringSplitter, Iterator<String>

java.lang.Object
   ↳ android.text.TextUtils.SimpleStringSplitter


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

TextUtils.SimpleStringSplitter(char delimiter)

Initializes the splitter.

Public methods

boolean hasNext()

Returns true if there is at least one more element, false otherwise.

Iterator<String> iterator()

Returns an Iterator for the elements in this object.

String next()

Returns the next object and advances the iterator.

void remove()

Removes the last object returned by next from the collection.

void setString(String string)

Sets the string to split

Inherited methods

From class java.lang.Object
From interface android.text.TextUtils.StringSplitter
From interface java.util.Iterator
From interface java.lang.Iterable

Public constructors

TextUtils.SimpleStringSplitter

Added in API level 1
TextUtils.SimpleStringSplitter (char delimiter)

Initializes the splitter. setString may be called later.

Parameters
delimiter char: the delimeter on which to split

Public methods

hasNext

Added in API level 1
boolean hasNext ()

Returns true if there is at least one more element, false otherwise.

Returns
boolean

iterator

Added in API level 1
Iterator<String> iterator ()

Returns an Iterator for the elements in this object.

Returns
Iterator<String> An Iterator instance.

next

Added in API level 1
String next ()

Returns the next object and advances the iterator.

Returns
String the next object.

remove

Added in API level 1
void remove ()

Removes the last object returned by next from the collection. This method can only be called once between each call to next.

setString

Added in API level 1
void setString (String string)

Sets the string to split

Parameters
string String: the string to split
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.