How to convert the list of string to upper and trim
Hey @Sweety_Girl
Use a for each loop to iterate through the list of string…
Inside the loop, use an assign activity to convert the value to upper case and trim.
Item = item.ToString.ToUpper.Trim
You try with C# functions
myList = myList.ConvertAll(d => d.ToUpper());
Hi @Sweety_Girl,
Using the Linq , you can do it in single statement.
- Declear a list string variable to get the result like name as lstResult.
- Using the assign activity lstResult = lstInput.Select(Function(a) a.ToUpper()).ToList()
Regards
Balamurugan.S
can we also add remove whitespace in this?
Just add trim like below
lstResult = lstInput.Select(Function(a) a.ToUpper().Trim()).ToList()
Hi @Sweety_Girl
Use for each item in LstResult
use item.ToString.Replace(" “,”")
Thanks
Ashwin S
this one
Any idea without looping
If you want to remove all the whitespace use below code
lstResult = lstInput.Select(Function(a) a.ToUpper().Replace(" ", string.Empty)).ToList()
Thank you so much
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.