StringComparison, why "TH" not start with "T"

132 Views Asked by At

I am using StringComparison, "vi-VN" culture; Why does comparing string "TH" or "Th".StartsWith("T", StringComparison.CurrentCulture) return false?

1

There are 1 best solutions below

1
On BEST ANSWER

Th is a grapheme in Vietnamese. It is a single unit of text, rather than two units of text as it would be in English. Thus, Th does not start with T, as it is it's own unique character.

You would need to use a culture which does distinguish between Th and the letters T and h. For example:

"Th".StartsWith("T", StringComparison.InvariantCulture)