If no better solutions, maybe you can use the result of IndexOf to extract various candidates, such as “G”, “Gr, “Gro, “Groß”, etc., until you find a match. You can use String.Compare(candicate, "grossen", StringComparison.CurrentCultureIgnoreCase). Then use the length of candidate.
How to get the length of text found with CurrentCulture?
Suppose I have a text "MaxGroßenIsHere". CurrentCulture is set to "de-DE" in my app. German has the character ß, which can often be written as ss, especially in computers. Therefore, "MaxGroßenIsHere".IndexOf("grossen", idx, StringComparison.CurrentCultureIgnoreCase)
returns 3, which is correct.
Now I would like to highlight the text found in my app in color. Unfortunately, I only know the length of the text I am looking for, but not the length of the found text. That's why the I in "MaxGroßenIsHere" is also highlighted and the search for any further text starts with "sHere" instead of "IsHere".
It is a UWP app.
How can I determine the length of the text found?