I want to replace a name like Ruben with R. How can i realise this.
So if the name is Stan i need S.
You can use assign activity as
NewName = OldName.substring(0,1)
0 is the starting index and 1 is the length.
Then another assign activity as
OldName = NewName simply or you can use replace method available already to replace
Here is the code:
Dim OldName As String = "Hareesh"
Dim NewName As String = OldName.Substring(0, 1)
OldName = NewName
Hi @438654
You can do this by using two assign activities.
Gets the first name of the name
Gets the first letter of the first name
Let know whether this helps to get your task done…
Doesn’t work. The name is read from excel. So Ruben is read from excel and must be R.
Buddy @438654
Great…
- Open the excel application scope to open the excel
- use read range activity to read the sheet where you have the value Ruben or any othernames
- Assign that read range activity output to a variable of type datatable named out_dt
4.Use for each row loop to iterate through each row in datatable - Use a assign activity to get the first character of the name in first row and first column (can change as per your document)
out_name = row(“ColumnName”).substring(0,1).ToString - Again use assign activity to change the name from Ruben to R like
row(“samecolumnname”) = out_name - Thats all buddy, you are all done
Hope this would help you
Cheers.
In case its coming from excel, then use the approach mentioned by @Palaniyappan… it will work
Thank you very much
Cheers…Buddy…Keep going
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.