Results 1 to 5 of 5

Thread: Left & Right

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    259

    Left & Right

    How can I get 4 letters from the left of string.

    I use (left function) and (right function) In VBScript but What Can I use in JavaScript

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    I cant remember the exact syntax, but you would use substring


    something to the effect of

    var a = stringvariable.substring(startpostion(4),length from startingposition);


    or soemthing like that. Is been a while
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  3. #3
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Code:
    stringName.substring(0,4)

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    ahh..I was close enough...
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  5. #5
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    I like your way of thinking - that's my motto too "Near enough is good enough"

Posting Permissions

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



Click Here to Expand Forum to Full Width