Most visited

Recently visited

Added in API level 1

TextUtils.StringSplitter

public static interface TextUtils.StringSplitter
implements Iterable<String>

android.text.TextUtils.StringSplitter
Known Indirect Subclasses


根据对此接口的用户不透明的规则分割字符串的接口。 与split相比,这还有更少的开销,它使用正则表达式并分配一个数组来保存结果。

使用这个类最有效的方法是:

 // Once
 TextUtils.StringSplitter splitter = new TextUtils.SimpleStringSplitter(delimiter);

 // Once per string to split
 splitter.setString(string);
 for (String s : splitter) {
     ...
 }
 

Summary

Public methods

abstract void setString(String string)

Inherited methods

From interface java.lang.Iterable

Public methods

setString

Added in API level 1
void setString (String string)

Parameters
string String

Hooray!