Hi There
I have a file name like SAPA-00431, SAPA-00596 I want to split this as string and want extract only like “431” , “596”…I have use something like this but its not working Split(ToArray)(-3-1)
You can do these
yourFileName.Substring(yourFileName.LastIndexOf("-")+1).ToString
Splitting in array
yourArray = yourString.Split("-",c)
Or this regex
(?<=\-)(.*)
Thanks,
Prankur
5 Likes
Assign → variable = string.Split("0"c)
Write line-> variable(2)
1 Like
Hy @rohit0510
Try this:
System.Text.RegularExpressions.Regex.Split(yourstring,“SAPA-00”)(1)
“yourstring” is filename string
string temp = “SAPA-00431”
temp.Substring(temp.Length-3)
Try this…
@rohit0510
Try this:
assign → MainString=“SAPA-00431”
writeline-> MainString.Split(“-”)(1).Substring(2,3)
Is it some how possible to change file name during move
Source: item.ToString ----->Array of object
this is my destination: Path.Combine(Environment.CurrentDirectory,“AllCsvWordDataFiles”)
so items name is currently like SAPA-00431 would like to change it to 431 while moving.
Any thoughts