Home > database >  How to turn a text string of all replacement
How to turn a text string of all replacement

Time:09-21

Such as: the asjdfo ~ ajsdfj ~ adfadljf ~ ~ of AD ~ ajdfkj ~ as a whole into/n

CodePudding user response:

Is that a few functions:
The pos (), left (), mid (), the replace ()

CodePudding user response:

Ha ha, I'm watching this several functions, is there any source code up,

CodePudding user response:

Actually in a cycle, and then replace what you want,

CodePudding user response:

You can download this:
http://download.csdn.net/download/xiajinxian/3429501

Replace function
The public function string replace (string as_text, string as_str1, string as_str2);//string substitution function

CodePudding user response:

String retstr
Long l_old l_new, l3, r_old
R_old=pos (initstr, oldstr)
L_old=len (oldstr)


If r_old & gt; 0 then
The do while r_old & gt; 0
Retstr=replace (initstr r_old, l_old, newstr)
Initstr retstr=
R_old=pos (initstr, oldstr)
Loop
End the if
Return retstr

CodePudding user response:

Later found out that this function is no problem, the key is ~ n is PB reserved characters, pos not to come out, so can't replace, ha ha

CodePudding user response:

Make a loop one-time fix
  • Related