var str,capstr:string; i,j:integer; .................... j:=500; //这个地方可能要根据你显示的宽度来换算对应的字符长度 str:=somestring; capstr:='' i:=1 while i<=length(somestring) do begin capstr:=capstr+copy(str,i,j)+#13#10; i:=i+j; end; label1.WordWrap:=true;
//delphi 7 Delphi汉字简繁体转换代码unit ChineseCharactersConvert; interface uses Classes, Windows; type TGBBIG5Convert = class(TObject) public class function BIG5ToGB(BIG5Str : String): AnsiString; class function GBToBIG5(GBStr : String): AnsiSt
//字符串转成16进制代码function strToHexStr(str:string):string;varc:char;ss:string;i:integer;beginwhile str<>'' do begin c:=str[1]; ss:=ss+format('%0x',[ord(c)]); delete(str,1,1);end;strtohexStr:= ss;end; //16进制字符串转换成字符串function HexStrToStr(const S
ios没有提供简单的汉字拼音排序方法,在网上看到了oc方法,这里写以下对应的swift方法 var stringCompareBlock: (String,String)->Bool = { (str1:String, str2:String) -> Bool in var nsStr1 = str1 as NSString var nsStr2 = str2 as NSString var encode:NSStringEncoding = CFStringConvertEncodingTo