Strreplace

xiaoxiao2021-03-06  85

package zpxx; public final class StrReplace {public static java.lang.String replace (java.lang.String strSource, java.lang.String strFrom, java.lang.String strTo) {java.lang.String strDest = ""; int INTFROMLEN = strfrom.length (); int int

while ((intPos = strSource.indexOf (strFrom)) = - 1!) {strDest = strDest strSource.substring (0, intPos); strDest = strDest strTo; strSource = strSource.substring (intPos intFromLen);} strDest = STRDEST STRSOURCE;

Return strdest;}}

转载请注明原文地址:https://www.9cbs.com/read-104908.html

New Post(0)