字符串替换函数是用哪个,比较我现在要把STR中所有的空格替换成''.

darkfoxp 2005-10-25 01:58:53
字符串替换函数是用哪个,比较我现在要把STR中所有的空格替换成''.
...全文
176 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
konhon 2005-10-25
  • 打赏
  • 举报
回复
uses StrUtils;
konhon 2005-10-25
  • 打赏
  • 举报
回复
AnsiReplaceText(Str, ' ', '');
darkfoxp 2005-10-25
  • 打赏
  • 举报
回复
具体怎么写
wdswcy 2005-10-25
  • 打赏
  • 举报
回复
Returns a string with occurrences of one substring replaced by another substring.

Unit

SysUtils

Category

string handling routines

Delphi syntax:

function StringReplace(const S, OldPattern, NewPattern: string; Flags: TReplaceFlags): string;

或自已做个
如:
//将字符串中的特定字符用另一个特定字符代替
//入口:str 指定的字符串
// s1 指定位置
// s2 代替特定字符的字符
Function updatastr(str: string;s1 :integer;s2:string): string;
var
tstr: string;
begin
tstr:=copy(str,1,s1-1) +s2;
tstr:=tstr+copy(str,s1,Length(str)-s1);
Result:=tstr;
end;
andrew223 2005-10-25
  • 打赏
  • 举报
回复
function StringReplace(const S, OldPattern, NewPattern: string; Flags: TReplaceFlags): string;
xixuemao 2005-10-25
  • 打赏
  • 举报
回复
AnsiReplaceStr

16,742

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 语言基础/算法/系统设计
社区管理员
  • 语言基础/算法/系统设计社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧