public static class

TextUtils.SimpleStringSplitter

extends Object
implements TextUtils.StringSplitter Iterator<E>
java.lang.Object
   ↳ android.text.TextUtils.SimpleStringSplitter

Class Overview

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 whether there are more elements to iterate, i.e.
Iterator<String> iterator()
Returns an Iterator for the elements in this object.
String next()
Returns the next object in the iteration, i.e.
void remove()
Removes the last object returned by next from the collection.
void setString(String string)
Sets the string to split
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.text.TextUtils.StringSplitter
From interface java.lang.Iterable
From interface java.util.Iterator

Public Constructors

public TextUtils.SimpleStringSplitter (char delimiter)

Initializes the splitter. setString may be called later.

Parameters
delimiter the delimeter on which to split

Public Methods

public boolean hasNext ()

Returns whether there are more elements to iterate, i.e. whether the iterator is positioned in front of an element.

Returns
  • true if there are more elements, false otherwise.

public Iterator<String> iterator ()

Returns an Iterator for the elements in this object.

Returns
  • An Iterator instance.

public String next ()

Returns the next object in the iteration, i.e. returns the element in front of the iterator and advances the iterator by one position.

Returns
  • the next object.

public void remove ()

Removes the last object returned by next from the collection. This method can only be called once after next was called.

public void setString (String string)

Sets the string to split

Parameters
string the string to split