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


Groups > comp.lang.javascript > #24944

Re: Can you change value of a substring?

Newsgroups comp.lang.javascript
Subject Re: Can you change value of a substring?
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References (2 earlier) <string-20140618222250@ram.dialup.fu-berlin.de> <XnsA350F12DEEDEBeejj99@194.109.133.133> <53a20f16$0$6670$9b4e6d93@newsspool3.arcor-online.net> <strings-20140619010717@ram.dialup.fu-berlin.de> <53a22539$0$6667$9b4e6d93@newsspool3.arcor-online.net>
Date 2014-06-19 09:56 +0200
Message-ID <XnsA3516518CBF33eejj99@194.109.133.133> (permalink)

Show all headers | View raw


Christoph Michael Becker <cmbecker69@arcor.de> wrote on 19 jun 2014 in 
comp.lang.javascript:

>>   A function can never change a string in any programming
>>   language, because a string is a value, just as a number.

When you see a string as a named value, you can change that value,
if you don't mind it is stored somewhere else every time.

Only Javascript offers no direct method to do that, well,
discounting the string operator +=, the method concat(), etc.

Unnamed string values inside methods, like regex methods, 
could be handled and stored quite differently inside the engine.


> I beg to differ.  Consider C:

I too beg to differ.

Concider original Forth, 

where each string is stored as a length value plus the the allotted number 
of bytes or words.

You can find the memory address of say the third character and change that.

But that is all semantics depending on the definition of "string". 

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

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


Thread

Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 12:39 -0700
  Re: Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 13:09 -0700
    Re: Can you change value of a substring? Christoph Michael Becker <cmbecker69@arcor.de> - 2014-06-18 23:18 +0200
      Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-19 00:35 +0200
        Re: Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 15:52 -0700
    Re: Can you change value of a substring? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-06-18 16:14 -0700
  Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-18 22:10 +0200
    Re: Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 13:17 -0700
      Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-18 22:52 +0200
        Re: Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 14:03 -0700
          Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-19 00:07 +0200
            Re: Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 15:28 -0700
    Re: Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 13:20 -0700
      Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-18 23:22 +0200
        Re: Can you change value of a substring? jonas.thornvall@gmail.com - 2014-06-18 14:40 -0700
          Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-19 00:31 +0200
    Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-18 23:42 +0200
      Re: Can you change value of a substring? Christoph Michael Becker <cmbecker69@arcor.de> - 2014-06-19 00:13 +0200
        Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-19 00:45 +0200
          Re: Can you change value of a substring? Christoph Michael Becker <cmbecker69@arcor.de> - 2014-06-19 01:32 +0200
            Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-19 09:43 +0200
        Re: Can you change value of a substring? Christoph Michael Becker <cmbecker69@arcor.de> - 2014-06-19 01:48 +0200
          Re: Can you change value of a substring? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-19 09:56 +0200
  Re: Can you change value of a substring? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2014-06-18 16:12 -0700

csiph-web