ANSI C中有20多个用于处理字符串的函数: 注意:const 形参使用了const限定符,表示该函数不会改变传入的字符串.因为源字符串是不能更改的. strlen函数: 函数原型:unsigned int strlen(const char*) 用于统计字符串的长度.举例如下 void fit(char *,unsigned int); int main(void) { char mesg [] = "Things should be as simple as possible,"…
此字符串分割函数用delphi编写,可以适应字符串中存在双字节字符和单字节字符. function TricheditEfm.SplitString(source:string;Sleng:Integer):TStringlist;stdcall; //字符串分割函数 ,按字符串长度分割 var copycount,i:Integer; //每个汉字占用两个字节长度 copystr:string; stringlist:Tstringlist; begin Stringlist:=Tstring…