Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

TextUtilsCompat

class TextUtilsCompat
kotlin.Any
   ↳ androidx.core.text.TextUtilsCompat

Backwards compatible version of TextUtils.

Summary

Public methods
static String
htmlEncode(@NonNull s: String)

Html-encode the string.

static Int

Returns the layout direction for a given Locale

Public methods

htmlEncode

@NonNull static fun htmlEncode(@NonNull s: String): String

Html-encode the string.

Parameters
s String: the string to be encoded
Return
String: the encoded string

getLayoutDirectionFromLocale

static fun getLayoutDirectionFromLocale(@Nullable locale: Locale?): Int

Returns the layout direction for a given Locale

Parameters
locale Locale?: the Locale for which we want the layout direction, maybe be null.
Return
Int: the layout direction, either ViewCompat#LAYOUT_DIRECTION_LTR or ViewCompat#LAYOUT_DIRECTION_RTL.