Re: cut from string using JScript

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Randy Webb (hikksnotathome_at_aol.com)
Date: 06/05/04


Date: Sat, 05 Jun 2004 10:13:45 -0400

Steve Fulton wrote:
> Randy Webb wrote:
>
>> Dave Anderson wrote:
>>
>>> Randy Webb wrote:
>>>
>>>>> How's about: myString.split("\/")[myString.length+1]
>>>>
>>>>
>>>> myString.length+1 isn't the element you would be looking for.
>>>
>>> That aside, if JScript is going to give you a great tool like
>>> Array.pop(),
>>> why not use it?
>>
>>
>> Support, or lack of, is the major problem with .pop() JScript 5.5 or
>> better, which is IE5.5 unless they have updated the JS Engine in IE4/5.
>
>
> Or unless you add your own support for it to the Array prototype. Simply
> put your code in a library that's included in each page and you stop
> worrying about how up-to-date the client is.
>
> Array Power, Part I
> bringing the IE Array object up to par
> http://www.webreference.com/dhtml/column31/index.html
>
> Array Power, Part II
> bringing the IE (and sometimes the Navigator) Array object up to par
> http://www.webreference.com/dhtml/column32/index.html
>

Yes, adding it to the prototype prevents it, but to me, it is like using
a chainsaw to cut your meat. Its overkill for the OP's question. And, I
dont care for libraries, others do.

-- 
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/


Relevant Pages

  • Re: cut from string using JScript
    ... Or unless you add your own support for it to the Array prototype. ... Array Power, Part II ... bringing the IE Array object up to par ...
    (microsoft.public.scripting.jscript)
  • Re: VB-101: Passing Arrays ByVal vs ByRef
    ... instance of the same array. ... They are three separate references to the same thing. ... Dim firstArray As Integer ... 'are referencing the same array object ...
    (microsoft.public.dotnet.languages.vb)
  • Re: VB-101: Passing Arrays ByVal vs ByRef
    ... instance of the same array. ... They are three separate references to the same thing. ... > Dim firstArray As Integer ... > 'are referencing the same array object ...
    (microsoft.public.dotnet.languages.vb)
  • Re: VB-101: Passing Arrays ByVal vs ByRef
    ... if passed ByVal, does not change the original array data in memory, because ... "an array object is created on the heap with two references". ... SecondDoublewould be a reference to firstArray and not a new object. ... > 'secondArray' and 'secondArrayCopy'. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: segmentation fault
    ... Operator als auch der + Operator als Ergebnis einen Zeiger in das selbe ... Array haben müssen. ... a pointer, the result has the type of the pointer operand. ... of the array object, provided they exist. ...
    (de.comp.lang.c)