Hi community
I'm trying to convert the first letter of each input text field to upper case. For example "raHul" would become "Rahul". I am using below method but its convert first letter .Is any one method available in outsystems ?Ex. String as a input parameter and its convert it with first letter with upper case and remaining string lower case.
ToUpper(SubStr(Name, 0, 1)) + SubStr(Name, 1, Length(Name))
RegardsRahul Jain
Rahul Jain wrote:
Hi,
Its is very simple, no need to write code. Just use this css - "text-transform: capitalize;"
Hello Rahul,
Your text allows only one word or is it allowed more than just one?
You can use ToUpper function for your first letter and ToLower function for the rest of the letters.
Kind regards,
Rui Barradas
Hi Rahul,
There are also a few string manipulation components available on the Forge.
One of which is String Utils which has a function UpperCaseFirst() that you can use.
Returns a new string upper casing the first character of the input.
Regards,
Nordin
Thanks for sharing
Use this expression for your case
ToUpper(Substr(Name,0,1))+ToLower(Substr(Name,1,Length(Name)))
Hope this will help you.
Regards
Rahul
Rahul Sahu wrote:
Is any one function not available in outsystems ? Like ToUpper , ToLower. Or Every time i have to call this scriptToUpper(Substr(Name,0,1))+ToLower(Substr(Name,1,Length(Name)))
Hello again Rahul,
Please refer to attached OML.
As you can see, here's the expected result:
You almost got it right :)
The below expression does the trick:
ToUpper(SubStr(Name, 0, 1)) + ToLower(SubStr(Name, 1, Length(Name) - 1))
If you're seeking to apply this to multiple words, you don't need to reinvent the wheel, the CamelCase component does what you need.
Hope it helps.
Cheers,
João
Unfortunately, there is no Built-In function to do that logic by default.
But you can always create your own common function with that specific logic and use it across your application :)
This will allow you to call your function instead of that script when you need it.
Something like this:
And then you can just call this function where you need it (instead of using the script):
Hope that this helps you!