void __fastcall tform1::button1click(tobject *sender) { ansistring test = "abcdef"; ansistring ins = "12345"; // 插入串 int pos = 3; // 在哪插 ansistring istr = test.insert( ins , pos ); //得到ab12345cdef }
void __fastcall tform1::button1click(tobject *sender) { ansistring test = "abcdef"; ansistring npos = test[3];//得到c } 【程序编程相关:迷茫?ping广播地址的回应】
取得ansi某一位字符 代码: 【推荐阅读:网站配色奥秘大公开】
void __fastcall tform1::button1click(tobject *sender) { ansistring test = "abcdef"; char *lstr = test.ansilastchar();//得到f } 【扩展信息:WebService Notes】
取得ansi里最后一个字符 代码:
取出ansi字符,这才是vb的mid函数! 代码:
void __fastcall tform1::button1click(tobject *sender) { ansistring test = "abcdef"; int first = 3; // 3开始取 int length = 2; // 取2位 ansistring getstr = test.substring( first , length ); //得到cd }
ansi的字母 是否相同比较 代码:
void __fastcall tform1::button1click(tobject *sender) { ansistring test = "abcdef"; ansistring sample = "abcdef"; int result = test.ansicompare( sample ); 返回1,不同!分大小写. }
代码:
... 下一页