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


Groups > comp.lang.javascript > #15647

Re: String Processing in JavaScript

From Mike Winter <usenet@michael-winter.me.invalid>
Newsgroups comp.lang.javascript
Subject Re: String Processing in JavaScript
References <rgf248la5ap1dusauc9ek39jasff47mht4@4ax.com>
Message-ID <Eyd0s.130221$lB3.128385@fx23.am4> (permalink)
Organization virginmedia.com
Date 2012-09-01 02:30 +0100

Show all headers | View raw


On 31/08/2012 23:56, Gene Wirchenko wrote:

[snip]

>       I have to delete because of how String.indexOf() works.  It does
> not have a string start point.

Yes it does. The String.prototype.indexOf method has a second, optional 
argument that specifies the position (zero-based, inclusive) from which 
the search begins. The same applies to String.prototype.lastIndexOf 
except that the default start is obviously the string length (the end) 
rather than 0.

For what it's worth, you can't actually delete characters from a string. 
Strings are immutable and any changes are separate, modified copies 
(with all the performance implications that may bring).

[snip]

Hope that helps,
-- 
Mike Winter
Replace ".invalid" with ".uk" to reply by e-mail.

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


Thread

String Processing in JavaScript Gene Wirchenko <genew@ocis.net> - 2012-08-31 15:56 -0700
  Re: String Processing in JavaScript Mike Winter <usenet@michael-winter.me.invalid> - 2012-09-01 02:30 +0100
    Re: String Processing in JavaScript Gene Wirchenko <genew@ocis.net> - 2012-09-02 17:56 -0700
  Re: String Processing in JavaScript Jim T. <x@y.z> - 2012-08-31 22:30 -0400
    Re: String Processing in JavaScript "Mel Smith" <med_cutout_syntel@aol.com> - 2012-08-31 21:47 -0600
      Re: String Processing in JavaScript "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-09-01 08:51 +0000
        Re: String Processing in JavaScript "Mel Smith" <med_cutout_syntel@aol.com> - 2012-09-01 08:38 -0600
      Re: String Processing in JavaScript Gene Wirchenko <genew@ocis.net> - 2012-09-02 18:04 -0700
        Re: String Processing in JavaScript "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-09-03 16:30 +0000
        Re: String Processing in JavaScript Mike Winter <usenet@michael-winter.me.invalid> - 2012-09-03 21:23 +0100
          Re: String Processing in JavaScript Gene Wirchenko <genew@ocis.net> - 2012-09-03 14:26 -0700
  Re: String Processing in JavaScript Stefan Weiss <krewecherl@gmail.com> - 2012-09-03 19:29 +0200
    Re: String Processing in JavaScript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-09-03 21:45 +0200
    Re: String Processing in JavaScript Gene Wirchenko <genew@ocis.net> - 2012-09-03 14:27 -0700
      Re: String Processing in JavaScript Stefan Weiss <krewecherl@gmail.com> - 2012-09-04 00:48 +0200
        Re: String Processing in JavaScript Gene Wirchenko <genew@ocis.net> - 2012-09-03 17:20 -0700
        Re: String Processing in JavaScript Tim Streater <timstreater@greenbee.net> - 2012-09-04 10:06 +0100
          Re: String Processing in JavaScript Ross McKay <au.org.zeta.at.rosko@invalid.invalid> - 2012-09-04 20:02 +1000
          Re: String Processing in JavaScript Gene Wirchenko <genew@ocis.net> - 2012-09-04 08:47 -0700

csiph-web