CharToByteIndex
简述
字符索引到字节索引的转换。
CharToByteIndex(const S: string; Index: Integer): Integer;
名称 | 类型 | 说明 |
---|
S | string | 字符串,源串 |
Index | Integer | 整数,字符位置 |
返回 | Integer |
整数,字符位置对应的字节位置 |
//返回第30字符对应的字节位置
//其中‘天软’占有4个字节,其余每个字符占1个字节
S:= "天软Tinysoft Statistical analysis Language";
return CharToByteIndex(s,30);
//返回:32