CharToByteLen
简述
判断字符串S中最多MaxLen的字符中占有的字节数。
CharToByteLen(const S: string; MaxLen: Integer): Integer;
名称 | 类型 | 说明 |
---|
S | string | 字符串,源串 |
MaxLen | Integer | 整数,字符个数 |
返回 | Integer |
整数,字节个数 |
//在S字符串中取30个字符,统计其所占的字节数。
//其中‘天软’占有4个字节,其余每个字符占1个字节,由此,30个字符占有32个字节
S:= "天软Tinysoft Statistical analysis Language";
b1:=CharToByteLen(S,30);
return b1;
//返回:32