How to take specific part of a string?

Hi,
I have an expression "PRODUCTION SALES PO: P143526 Quotation "
I want to take the P143526 part from this expression.
Colon up ( : ) is standart the others can change.
How can I do that?
Thank you.

HI @makboga

How about this expression

YourString = “PRODUCTION SALES PO: P143526 Quotation”

System.Text.RegularExpressions.Regex.Match(YourString,"(?<=:\s)\S+").Tostring

image

Thank you for quick reply but this didn’t work for me.

Below formula worked for me.
System.Text.RegularExpressions.Regex.Match(Definition,“(?<=:)\S+$*”).Tostring.Trim

image

Based on the input I have provided the reflex expression. @makboga for me it working.

Kindly close this topic by mark as solved. So it will help for others too.

This expression is working based on your input

image

Regards
Gokul

hI @makboga

Check on this expression

Split("PRODUCTION SALES PO: P143526 Quotation".Substring("PRODUCTION SALES PO: P143526 Quotation".Indexof(":"))," ")(1)

You can use a variable in the above expression
StrVar= “PRODUCTION SALES PO: P143526 Quotation”

Split(StrVar.Substring(StrVar.Indexof(":"))," ")(1)

Regards
Sudharsan

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