Hi iam trying to remove first line from a string variable
actually i try to remove every characters except numbers using this expression “[^\d-.]”
But in my case the variable value includes number in first line like below mentioned
“Column1
20232003”
So any help can be appreciable
Thanks in advance
if it is exactly a line then split by line and use the second part
Anil_G
(Anil Gorthi)
3
@jai_kumar2
You can actually use split for it
str.Trim.Split({Environment.NewLine,"\r\n","\n",vbcrlf},2,StringSplitOptions.RemoveEmptyEntries)(1)
cheers
Yoichi
(Yoichi)
4
HI,
How about the following expression?
System.Text.RegularExpressions.Regex.Replace(yourString,"^.*\n","")
Regards,
HI @jai_kumar2
You can also use this
System.Text.RegularExpressions.Regex.Match(InputString,"\d+").Tostring
This with get you only the numbers
Regards
Sudharsan
Gokul001
(Gokul Balaji)
6
Hi @jai_kumar2
How about this Regular expression?
System.Text.RegularExpressions.Regex.Replace(InputString,"\S+\d+\n","")
Regards
Gokul
Dont try above @jai_kumar2
Try this updated one
System.Text.RegularExpressions.Regex.Matches(InputString,"\d+",System.Text.RegularExpressions.RegexOptions.Multiline)(1).ToString
Regards
Sudharsan
system
(system)
Closed
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.