StringUtils FindInbetween Method C# API
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.Util
Assembly: fc_clr (in fc_clr.dll) Version: 9.5.5.77
Syntax

public static string FindInbetween(
	string text,
	string startPattern,
	string endPattern,
	bool ignoreCase
)

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

The following example demonstrates finding the text in a HTML tag's name attribute, by searching between name=" and ">.
// 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