i need to replace "stringA" with "stringAstringB"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jx2
    New Member
    • Feb 2007
    • 228

    i need to replace "stringA" with "stringAstringB"

    lets say i've got a str="john michael luise+marry"
    i need to replace all ocurrance of name with name+surname
    eg str2= "johnBrown michealBrown luiseBrown+marr yBrown"

    i gues i need something like this str.replace and \[a-z]+\
    but... i have no idea how to do it

    could you help me?
    regards
    jx2
  • jx2
    New Member
    • Feb 2007
    • 228

    #2
    lol thanks guys but i was quicker :-)
    dola$$$$ made my day
    str.replace(/([a-z]+)/g,"$1"+name)

    :-)

    Comment

    Working...