Created
June 9, 2013 11:04
-
-
Save SebRut/5743173 to your computer and use it in GitHub Desktop.
returns the string between two identifiers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static string GetStringBetween(string source, string start, string end) | |
{ | |
int startIndex = source.IndexOf(start, StringComparison.Ordinal) + start.Length; | |
int endIndex = source.IndexOf(end, startIndex, StringComparison.Ordinal); | |
int length = endIndex - startIndex; | |
return source.Substring(startIndex, length); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment