Tuesday, October 23, 2018

JQuery: how to replace all between certain characters?

Syntax:
string.replace(/abc.+xyz/,"abc"+newString+"xyz");


Input value :
 var inputString="(10.00%)(20.00%)(10.00%)Testing Value";

 var   Output =inputString.replace(/\(.*%\)/ig,"");

Result value :
    Testing Value


No comments:

Post a Comment

Mixed Content: The page at xxx was loaded over HTTPS, but requested an insecure

 Mixed Content: The page at ' https ://www.test.com/signup.aspx' was loaded over HTTPS, but requested an insecure script ' http ...