Searches for two strings in text and returns the text between them, or an empty string if the patterns could not be matched.
Namespace: Facilita.UtilAssembly: fc_clr (in fc_clr.dll) Version: 9.5.8.37
Syntax
Parameters
- text
- Type: System String
The string to search in.
- startPattern
- Type: System String
A string which occurs immediately before the text to be extracted.
- endPattern
- Type: System String
A string which occurs immediately after the text to be extracted.
- ignoreCase
- Type: System Boolean
true if the search should be case-independent.
Return Value
The string found between the start and end patterns, or an empty string if is there is no match.Examples
// If the web page contained the string ...name="John Smith">, this call will return // the text "John Smith" (excluding the quotes) string page = response.Content; // get the contents of the response string myValue = StringUtils.FindInbetween(page, "name=\"", "\">", true); // find the text between value=" and ">
See Also