ToTitleCaseTransformation class
A transformation to convert a String into title case.
Title casing ensures that the first letter of each word is capitalized. By default, acronyms are excepted from
conversion. However, if convertAcronyms is true
, they will also be converted with the same logic.
Words are demarcated by whitespace, which is retained in its original form after conversion to title casing. No attempt is made to identify short prepositions in order to avoid capitalizing them, though this may be refined in the future.
final transformation = ToTitleCaseTransformation(convertAcronyms: false);
// 'Here Is Some Text, FYI. I Hope You Like It! Peace'
transformation.transform('here is some text, FYI. I hope you like it! peace', 'en_US');
- Inheritance
-
- Object
- Transformation<
String, String> - ToTitleCaseTransformation
- Available Extensions
Constructors
- ToTitleCaseTransformation({required bool convertAcronyms})
-
const
Properties
- convertAcronyms → bool
-
true
if acronyms should be converted, orfalse
to leave them capitalized.final - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
transform(
String input, String locale) → String -
Transforms
input
into an instance ofU
using the providedlocale
.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited