public final class UpperCaseFilter extends InputFilter
RichText.
When lowercase characters exist in the text to be filtered, they will be converted to uppercase if
the corresponding uppercase characters exist in the specified Locale.
InputFilter.Range| 构造器 | 说明 |
|---|---|
UpperCaseFilter() |
A constructor used to create an
UpperCaseFilter instance based on the current Locale. |
UpperCaseFilter(String locale) |
A constructor used to create an
UpperCaseFilter instance based on a specified locale. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
CharSequence |
filter(CharSequence source,
InputFilter.Range sourceRange,
CharSequence dest,
InputFilter.Range destRange) |
Filters the input text, which can be plain text or
RichText. |
public UpperCaseFilter()
UpperCaseFilter instance based on the current Locale.public UpperCaseFilter(String locale)
UpperCaseFilter instance based on a specified locale.public CharSequence filter(CharSequence source, InputFilter.Range sourceRange, CharSequence dest, InputFilter.Range destRange)
RichText.
If the source is rich text, the text itself will change. In other cases, the text will not change.
Depending on the derived class of InputFilter, determine whether to pass null to dest
and destRange.
For example, pass null if the derived class is CharInputFilter or UpperCaseFilter.
For LengthFilter, do not pass null to dest and destRange, because these two
parameters restrict the source text together with sourceRange.filter 在类中 InputFiltersource - Indicates that source strings to be filtered.sourceRange - Indicates the filtering range of the source text. Only text in this range is filtered.dest - Indicates the destination text.destRange - Indicates the filtering range of the destination text.null if the input source text is null or the
specified Range is invalid.