Alternate characters in upper and lower case (explain this example)

Alternate characters in upper and lower case (explain this example) Add a space after each character in the string. You can use console or message box to display your output. For example, if the strings are “bangalore”, “mumbai” and “delhi”, your program should output:
BaNgAlOrE
b a n g a l o r e
MuMbAi
m u m b a i
DeLhI
d e l h i
Hint:
Built-in string manipulation methods can be used
Look at the index position of characters in the word to do necessary changes/insertions
Please do provide the solution for this task.

1 Like

Hi

Hope the below steps would help you resolve this

  1. Say you have a string variable named Strinput

  2. Use a assign activity like this to get the desired output string

Stroutput = String.Join(“ “, Strinput.ToLower.ToString.ToCharArray())

Cheers @Gopikrishna_S

Hi,

Can you try the following expression?

String.Join("",yourString.Select(Function(c,i) if(i mod 2 =0,c.ToString.ToUpper,c.ToString.ToLower)))

Regards,

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