-1

Possible Duplicate:
Replace all spaces in a string with '+'

how to remove ,@contacts.Assessor.firstname@ @contacts.Assessor.lastname@ and ,@contacts.Assessor - Secondary.firstname@ @contacts.Assessor - Secondary.lastname@ from a string in javascript?

Thanks

Community
  • 1
  • 1
Karim Ali
  • 2,243
  • 6
  • 23
  • 31
  • `str = str.replace( /foo/g, '' );` where `foo` is the text you want to remove (you'll have to escape the dots and ad-symbols) – Šime Vidas Dec 12 '11 at 17:40
  • Also duplicate of about 300 other questions - http://stackoverflow.com/search?q=javascript+string+replace – Chris Baker Dec 12 '11 at 17:48

1 Answers1

1

Simply use .replace()

string = string
         .replace(',@contacts.Assessor - Secondary.firstname@ @contacts.Assessor - Secondary.lastname@', '')
         .replace(',@contacts.Assessor.firstname@ @contacts.Assessor.lastname@', '');

Also take a loot at this related question

Community
  • 1
  • 1
Martin.
  • 10,494
  • 3
  • 42
  • 68