Extract the number fromaftercomment

1716510480 Comment: 9497 6/1/2019 7/10/2019 $20.77 $0.00 $20.77
Total: $20.77

Hai i need to extract the 9497 number in after comment
could u please tell me the regex options

Use this

text.Substring(text.IndexOf("Comment: ")+"Comment: ".Length).Split(Environment.NewLine.ToCharArray)(0)

2 Likes

Hi @veera_g

Kindly try with this buddy
if the input string is like this
in_str = β€œ1716510480 Comment: 9497 6/1/2019 7/10/2019 $20.77 $0.00 $20.77
Total: $20.77”

then the output will be
out_Str = Split(Split(in_str.Split(Environment.Newline.ToArray())(0),": β€œ)(1).ToString.Trim,” ")(0).ToString.Trim

Cheers @veera_g

1 Like

@veera_g you can try also this buddy split(text.Split(environment.NewLine.ToArray(),stringsplitoptions.RemoveEmptyEntries)(0)," ")(2).ToString

1 Like

[quote=β€œveera_g, post:5, topic:132061”]
Its fine working for me i have another doubt suppose i need after the num like 1716510480 after 9497 means

1716510480 9497 6/1/2019 7/10/2019 $20.77 $0.00 $20.77
Comment:
[/quote]Its fine working for me i have another doubt suppose i need after the num like 1716510480 after 9497 means

1716510480 9497 6/1/2019 7/10/2019 $20.77 $0.00 $20.77
Comment:

1 Like

i didn’t get this buddy
kindly come again once
Cheers @veera_g

After the 1716510480

β€œ1716510480 Comment: 9497 6/1/2019 7/10/2019 $20.77 $0.00 $20.77"
do you mean in the highlighted one in the above string as output

Cheers @veera_g

am waiting your replay

1 Like

is this needed @veera_g

text.Substring(text.IndexOf("1716510480 ")+"1716510480 ".Length).Split(Environment.NewLine.ToCharArray)(0)

s we needed and we need another if comment is present or not present we extract the 5 digit number

Any possible code to get 5 digit number or 4 digit number after the 1716510480

str.Substring(str.IndexOf(β€œ1716510480”),5)

Try this to get 5 characters after that particular string

1 Like

s got it

Thanks for your quick help

:slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.