简体   繁体   中英

Change value of field

i got some confusion in String Replacement. i have string like

CustomerEmailID=fake; NavigatePageValue=0; IsCustomerInsertSucess=asdewewew;

in this string i need to change value of IsCustomerInsertSucess to others. but i am confuse that how can i

i have try with

String s1 = "CustomerEmailID=fake; NavigatePageValue=0; IsCustomerInsertSucess=asdewewew;";
s1 = s1.replaceAll("IsCustomerInsertSucess=(.*?);", "2026");

but its replace entire field also i need to change value only can you please help me

最简单的方法(不是最聪明的方法)是将第二行更改为

s1 = s1.replaceAll("IsCustomerInsertSucess=(.*?);", "IsCustomerInsertSucess=2026");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM