How can I parse this string to get a specific value?

68 Views Asked by At

How can i parse this string

https://20.85.239.243:50000/b1s/v1/Orders(26)

to get the value 26 in a variable?

1

There are 1 best solutions below

0
rizaldodo On BEST ANSWER

If the string literally like that you can use substring instead. Maybe like this :

string.Substring((string.Length-4), 2)

Or maybe you can find what you need here: https://learn.microsoft.com/en-us/dotnet/api/system.string.substring?redirectedfrom=MSDN&view=net-6.0#overloads