Need String manipulation

I have a string

I am an automation developer.

Need output as

I
AM
AN
Automation
Developer

Can anyone help on this

Hi @Soumith


Assign activity:
outputArray = inputString.Split(" ".ToCharArray, StringSplitOptions.RemoveEmptyEntries)

1 Like

Hi @Soumith

inputString= "I am an automation developer"
textArray= inputString.Split(" ".ToCharArray, StringSplitOptions.RemoveEmptyEntries)
For Each currentItem in textArray
formattedWord = currentItem.Substring(0, 1).ToUpper() + currentItem.Substring(1).ToLower()
   WriteLine-> formattedWord 
End For Each


Output:

image

inputString= "I am an automation developer"
textArray= inputString.Split(" ".ToCharArray, StringSplitOptions.RemoveEmptyEntries)
For Each currentItem in textArray
   WriteLine-> currentItem.ToString.ToUpper 
End For Each


image

Regards

1 Like

Hi @Soumith

You can simply try this

String.Join(Environment.NewLine,InputString.Split(" "c, StringSplitOptions.RemoveEmptyEntries).Select(Function(word) word.ToUpperInvariant()))

Cheers!!

1 Like

Hi @Soumith

- Assign -> Input = "I am an automation developer"
- Assign -> Output = ""
- For each -> Input.Split(" ")
     - Assign -> Output = Output+Environment.NewLine+currentItem
- Write Line -> Output.toString.Trim

Check the below image for better understanding,

Output as expected,
image

Hope it helps!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.