Input: str = “abcdef”
Output: ace
Explanation:
The characters ‘b’, ‘d’ and ‘f’ are present at odd indices, i.e. 1, 3 and 5 respectively. Therefore, they are removed from the string.
Input: str = “geeks”
Output: ges
by using UiPath how we do that
Input: str = “abcdef”
Output: ace
Explanation:
The characters ‘b’, ‘d’ and ‘f’ are present at odd indices, i.e. 1, 3 and 5 respectively. Therefore, they are removed from the string.
Input: str = “geeks”
Output: ges
by using UiPath how we do that
One way would be to use substring:
str_input = "abcdef"
str_output = str_input.Substring(0, 1) + str_input.Substring(2, 1) + str_input.Substring(4, 1)
Here is a very good post:
inputString = "abcdef"
resultString = ""
inputString.ToCharArray()
inputString.IndexOf(currentChar) Mod 2 = 0
resultString = resultString + currentChar.ToString
Note: Attached the workflow for better understanding and reference.
Main.xaml (8.7 KB)
Hope it helps!!
Regards,
Hi,
Can you try the following expression?
String.Join("",yourString.Where(Function(c,i) i mod 2=0))
Regards,
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.