Click or drag to resize

StringAlgorithmsCharactersInOrder Method

Note: This API is now obsolete.

Checks if the characters of one of the strings occur in order in the other string. Returns the number of characters in the two strings that match in order. The value will be between 0 and the size of the smallest string.

Examples
The following strings match, since the one fully contains the other in order
CharactersInOrder("BLUB","aBcLeUgBh") = 4
CharactersInOrder("aBcLeUgBh","BLUB") = 4
The following strings differ by one, since the final B is missing in the long string
CharactersInOrder("BLUB","aBcLeUg") = 3
CharactersInOrder("aBcLeUg","BLUB") = 3

Namespace:  DHI.Mike1D.Generic
Assembly:  DHI.Mike1D.Generic (in DHI.Mike1D.Generic.dll) Version: 19.0.0.0 (11.1.1.1111)
Syntax
[ObsoleteAttribute("Use LongestCommonSubsequence")]
public static int CharactersInOrder(
	string s1,
	string s2
)

Parameters

s1
Type: SystemString
String to search for
s2
Type: SystemString
String to search in

Return Value

Type: Int32
0 if full match, > 0 for partial match
See Also