Hi team,
I have a string “139204502930259406835392043409548409409586392049777396029396849302”
Now i want to split this string with every 5 characters.
The expected output is :
13920
45029
30259
40683
.
.
.
.
etc
Please suggest me if you have something.
Regards,
Sateesh.
jast1631
(Jagravi Trivedi)
2
Hi @sateesh.thandra
Try these :
-
Open the Invoke Code activity.
-
Set up your inputString variable with the value - assign this to string variable with in direction to use inside code
-
“139204502930259406835392043409548409409586392049777396029396849302”.
-
Create a chunks variable as a List(Of String) to store the split strings.- this will be assigb the direct out in your invoke code
-
Use the following code in the Invoke Code activity
Dim inputString As string
Dim chunks As New List(Of String)
For i As Integer = 0 To inputString.Length - 1 Step 5
Dim chunk As String = inputString.Substring(i, Math.Min(5, inputString.Length - i))
chunks.Add(chunk)
Next
to access chunks outside the Invoke Code activity, make sure to pass it as an Out Argument in the activity’s properties.
use regex and split it
System.Text.RegularExpressions.Regex.Matches(“139204502930259406835392043409548409409586392049777396029396849302”, “.{1,5}”).Cast(Of System.Text.RegularExpressions.Match).Select(Function(m) m.Value).ToList()
assign the above expression into list of strings
Erimateia
(Erimateia Lima)
4
Hi @sateesh.thandra
Fallow the steps below. If I helped you, please maket it as solved.
Here is the code.
Main.xaml (5.2 KB)
Thanks this worked for me.
system
(system)
Closed
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.