TextUtils

Class of android.text · TextUtils.java · Android's reference

public class TextUtils

Text helpers.

Nested types

Fields

public static final int CAP_MODE_CHARACTERS = 0x1000 source
public static final int CAP_MODE_WORDS = 0x2000 source
public static final int CAP_MODE_SENTENCES = 0x4000 source
public static final int SAFE_STRING_FLAG_TRIM = 0x1 source
public static final int SAFE_STRING_FLAG_SINGLE_LINE = 0x2 source
public static final int SAFE_STRING_FLAG_FIRST_LINE = 0x4 source
public static final android.os.Parcelable.Creator<CharSequence> CHAR_SEQUENCE_CREATOR source

Methods

public static boolean isEmpty(CharSequence s) source
public static boolean isGraphic(CharSequence s) source
public static boolean isDigitsOnly(CharSequence s) source
public static int getTrimmedLength(CharSequence s) source
public static boolean equals(CharSequence a, CharSequence b) source
public static String join(CharSequence delimiter, Object[] tokens) source
public static String join(CharSequence delimiter, Iterable<?> tokens) source
public static String[] split(String text, String expression) source
public static CharSequence expandTemplate(CharSequence template, CharSequence... values) source

The template with ^1 to ^9 replaced by the values and ^^ by ^, as Android's (its spans are not kept here, the text is a String)

public static CharSequence concat(CharSequence... text) source
public static String substring(CharSequence source, int start, int end) source
public static void getChars(CharSequence s, int start, int end, char[] dest, int destoff) source
public static int indexOf(CharSequence s, char ch) source
public static int indexOf(CharSequence s, char ch, int start) source
public static int indexOf(CharSequence s, char ch, int start, int end) source
public static int lastIndexOf(CharSequence s, char ch) source
public static int lastIndexOf(CharSequence s, char ch, int last) source
public static int lastIndexOf(CharSequence s, char ch, int start, int last) source
public static int indexOf(CharSequence s, CharSequence needle) source
public static int indexOf(CharSequence s, CharSequence needle, int start) source
public static int indexOf(CharSequence s, CharSequence needle, int start, int end) source
public static int getOffsetAfter(CharSequence text, int offset) source

The offset after the character at offset: past a surrogate pair, and past a replacement span that covers it.

public static int getOffsetBefore(CharSequence text, int offset) source
public static CharSequence stringOrSpannedString(CharSequence source) source
public static String htmlEncode(String s) source
public static int getLayoutDirectionFromLocale(Locale locale) source
public static CharSequence ellipsize(CharSequence text, TextPaint p, float avail, TruncateAt where) source
public static CharSequence ellipsize(CharSequence text, TextPaint paint, float avail, TruncateAt where, boolean preserveLength, EllipsizeCallback callback) source
public static int getCapsMode(CharSequence cs, int off, int reqModes) source
public static void writeToParcel(CharSequence cs, android.os.Parcel p, int parcelableFlags) source
public static String nullIfEmpty(String str) source
public static String emptyIfNull(String str) source
public static CharSequence trimToSize(CharSequence text, int size) source

Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.