Right Function using JavaScript??

Results 1 to 3 of 3

Thread: Right Function using JavaScript??

  1. #1
    Join Date
    Dec 1969

    Default Right Function using JavaScript??

    Is there a similar function or way of obtaining the last digit/character of a field using JScript? I know this can be done using VBScript.<BR><BR>Thanks for any help.<BR>Lisa

  2. #2
    Join Date
    Dec 1969

    Default RE: Right Function using JavaScript??

    I think you have to use substring or substr or whatever the method is in JavaScript.<BR><BR>As far as I know, it doesn&#039;t natively support Right() and Left().

  3. #3
    Join Date
    Dec 1969

    Default Write your own...

    ...it&#039;s trivial enough:<BR><BR>function right( str, count )<BR>{<BR> return str.substring( str.length - count );<BR>}<BR><BR>function left( str, count )<BR>{<BR> return str.substring( 0, count );<BR>}<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts