Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #37126

string.replace()

From Martin Leese <please@see.Web.for.e-mail.INVALID>
Newsgroups comp.lang.javascript
Subject string.replace()
Date 2019-08-13 14:18 -0600
Organization A noiseless patient Spider
Message-ID <qiv5ub$i5$1@dont-email.me> (permalink)

Show all headers | View raw


I nice easy one to start the day.

I wish to replace spaces in a string with
"+" characters.  I am using:
     var mungedTopic;
     mungedTopic.replace(/ /g, "+");

but the spaces are not replaced.  There can
be multiple spaces, and I want to replace
them all.  I therefore need to use a regular
expression rather than a string.  I guess my
regular expression is wrong, but I don't see
why.

-- 
Regards,
Martin Leese
E-mail: please@see.Web.for.e-mail.INVALID
Web: http://members.tripod.com/martin_leese/

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

string.replace() Martin Leese <please@see.Web.for.e-mail.INVALID> - 2019-08-13 14:18 -0600
  Re: string.replace() dr.j.r.stockton@gmail.com - 2019-08-13 14:52 -0700
    Re: string.replace() Martin Leese <please@see.Web.for.e-mail.INVALID> - 2019-08-14 15:36 -0600
  Re: string.replace() "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-08-14 10:18 +0200
    Re: string.replace() Martin Leese <please@see.Web.for.e-mail.INVALID> - 2019-08-14 15:41 -0600
      Re: string.replace() "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2019-08-15 13:55 +0200

csiph-web