Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java add forward / at the end of not present

const regex = new RegExp("^(/[a-z0–9/_-]*)");
console.log("/newsgjgjgj".replace(regex, "$1/"));
console.log("/news?param1=value1".replace(regex, "$1/"));
console.log("/news#anchor?param1=value1".replace(regex, "$1/"));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #java #add #present
ADD COMMENT
Topic
Name
2+4 =