Change casing (e.g. to upper case or lower case)

Is there a way to change the casing of a LocalizedString?

For example, my string says:
“Action Points”

I want to get that string formatted as:
“ACTION POINTS”
or
“action points”

This would save on the number of items I have to localize, as otherwise I need individual items for each casing version, which is more costly, plus then it’s prone to error having different translations for each one.

I couldn’t see anything in the documenation about this but maybe I’m missing something.

Thanks!

Yes you can do this with Smart Strings. The Argument can be converted e.g {0.ToUpper} to make it upper case.
If you just want to make a LocalizedString uppercase then the best way would be to make it a nested string and then do the ToUpper in the main string.
E.G

https://docs.unity3d.com/Packages/com.unity.localization@1.0/manual/Smart/Reflection-Source.html?q=ToUpper

Great! Thanks for the quick response. I’ll give this a try.

EDIT: Worked a treat. Thanks

1 Like