Simple String Parse Question

beantownace

Active member
Joined
Feb 15, 2019
Messages
26
Programming Experience
5-10
Hello all,

How can I get a value within this string:
"A valid security is required for subject: Order, key: order: DFIL13898921680001, error: "

I want to only get the DFIL13898921680001

Thanks for any assist parsing this best way.
 
What are the rules that defines a valid ID? Will it always start with that prefix? Is there a maximum length? Will the prefix always be followed by numbers?
 
Hello all,

How can I get a value within this string:
"A valid security is required for subject: Order, key: order: DFIL13898921680001, error: "

I want to only get the DFIL13898921680001

Thanks for any assist parsing this best way.
Consider using regex (regular expression) for this.
 
A regex maybe overkill for cases when IndexOf() and LastIndexOfAny() maybe sufficient. It really depends on what rules govern the construction of the key string.
 
Back
Top Bottom