I have a String “01021026888” and I have an int variable numOfTimes.
lets say the value of numOfTimes is 3, I want the string “01021026888” to be manipulated by replacing on the first 3 leftmost values, and this value must be unique in every instance. For example,
Given “01021026888” and numOfTimes = 4, the business wants a text file containing
11121026888
10121026888
23421026888
00121026888
the value of the first three leftmost digit does not matter as long as they are unique for each instance.
Assigns:
str_input = "01021026888"
rd = new Random() (type: System.Object[])
list_resultList = New List(Of String) From {str_input}
While (list_resultList.Count < 4)
Assigns:
newString = (rd.Next(1000).ToString().PadLeft(3, "0"c)) & str_input.Substring(3)
Append Item to list activity to add newString to list_resultList
list_resultList = list_resultList .Distinct().ToList()
counter = counter+1
For Each item In list_resultList
Use Append line activity to add currentItem to the text file
If the suggestions (Other) provided does not work for your case, could you maybe provide us another example with with numOfTimes as 3 and one more with numOfTimes as 4 ? Just so that we can clear the confusions and get the requirement understood.
@ppr@supermanPunch
I dont know what I’m doing wrong here. Is this where I’m assigning value to a random var using the assign activity? Or I’m I doing this all wrong?