Hello All,
i am new here and started explore the tool but came across small use case where bot has to take 2a3b4c as input and retrun aabbbcccc as output.
so, can you please suggest me the best way to do it.
thank you
Hello All,
i am new here and started explore the tool but came across small use case where bot has to take 2a3b4c as input and retrun aabbbcccc as output.
so, can you please suggest me the best way to do it.
thank you
Can you try this
Output = String.Concat(System.Text.RegularExpressions.Regex.Matches(Input,"(\d+)([a-zA-Z])").Cast(Of System.Text.RegularExpressions.Match).Select(Function(m) New String(m.Groups(2).Value(0),CInt(m.Groups(1).Value))))
Regards,
great, its working.
but can we make more dynamic since input is expected to change dynamically(ex 3d2c5h7y or 3v6h7a ).
thank you
yes, its working, thank you
FYI, another approach:
System.Text.RegularExpressions.Regex.Replace(strInput,"(\d+)(\D)",Function(m) New String(m.Groups(2).Value.ToCharArray.First ,Cint(m.Groups(1).Value)))
Use below exp:
Output = String.Concat(System.Text.RegularExpressions.Regex.Matches(Input, “(\d+)([a-zA-Z])”).Cast(Of System.Text.RegularExpressions.Match).Select(Function(m) New String(m.Groups(2).Value(0), CInt(m.Groups(1).Value))))
@learnrpa0910
Uipath_batch (3).zip (1.9 MB)
Use below zip file here you can get the soltion