Using for each in if condition

Hi Team,

how to i convert T Yesu Raju as t yeSU raju by using for each in if condition

Please let me know

Can you give further explanation?

Use below approach:

  1. Assign activity: originalString = “T Yesu Raju”

  2. Assign activity: convertedString = “”

  3. For Each activity (item: currentChar, in: originalString)
    4. If activity (Condition: currentChar = Char.ToLower(currentChar) and currentChar <> Char.ToUpper(currentChar))
    5. Assign activity: convertedString = convertedString + currentChar.ToLower()
    6. Else
    7. Assign activity: convertedString = convertedString + currentChar

  4. Log Message activity: convertedString

Hi @T_Y_Raju

Assign: inputString = “T Yesu Raju”

ForEach: item in inputString.toCharArray

 Assign: outputString = If(Char.IsUpper(item) AndAlso item <> " ", Char.ToLower(item).ToString, 
 item.ToString)

MessageBox: outputString

Hope it helps!!

Hi @T_Y_Raju

Try this

  • Assign inputString = “T Yesu Raju”
  • Assign outputString = “”
  • For Each item in inputString.ToCharArray()
    • If Char.IsUpper(item)
      • Assign outputString = item.ToString().ToLower()
    • Assign outputString = outputString + item.ToString()

I hope it helps!!

@T_Y_Raju ,Try this

  1. Assign a string Variable = “T Yesu Raju”
    For Each charItem in the stringVariable.ToCharArray
    If (Char.IsUpper(charItem))
    Assign to a String variable = Stringvariable.Replace(charItem, Char.ToLower(charItem))
    Else
    Assign to a String variable = Stringvariable.Replace(charItem, charItem)

@T_Y_Raju ,
Check this workflow

Main.zip (2.0 KB)

Input :

“T Yesu Raju”

Output :
image

Regards,