Pattern: Directional trim method names
Issue: -
The trimLeft
and trimRight
methods are legacy aliases that can be confusing due to their direction-dependent naming. Use trimStart
and trimEnd
instead for better consistency with other language features and clearer directional independence.
Example of incorrect code:
str.trimLeft();
str.trimRight();
Example of correct code:
str.trimStart();
str.trimEnd();