How can get substring when the string have both Chinese characters and English characters to meet Oracle requirements?

Hi,

Is the encoding UTF-8? in UTF-8, Chinese character is usually encoded as 3 bytes but not always. So we need to evaluate actual byte length, I think. Can you try the following expression?

yourString.Substring(0,Enumerable.Range(0,maxLimit).Where(Function(i) System.Text.Encoding.GetEncoding("UTF-8").GetBytes(yourString.Substring(0,i)).Length<maxLimit).Max)

If your encoding is not UTF-8, please modify it to your encoding.

Regards,