Tag Archives: string

Get value between two strings

You might find this snippet particular useful in cases where you want to get a value between two other values.

This takes advantage of the string’s Split overload to pass an array of two values. This will result in the string being split twice, once for the first value in the array and once more for the second value. The result will be that the second value in the array that Split returns is the actual value between the first and the second value we passed as argument.

Code:

Example: