Results 1 to 5 of 5

Thread: [RESOLVED] error in len(...)

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    14

    Resolved [RESOLVED] error in len(...)

    hey somhow i cant take away inside len(..)
    for example i want to get a string of text "hello lol"
    say i want to get the lol from the "hello lol"
    i tried right("hello lol", len("hello lol" - 6)) but that didnt work
    how can i get this working thanks ^_^

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: error in len(...)

    msgbox Right("Hello lol",3)
    or
    msgbox Right("Hello lol",Len("Hello lol")-6)
    or
    str = "Hello lol"
    msgbox Right(str,len(str)-6)

    you have to have the -6 outside then len()
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: error in len(...)

    Or
    VB Code:
    1. Private Sub Command1_Click()
    2. Dim strString As String
    3. Dim arrString() As String
    4. strString = "Hello lol"
    5. arrString = Split(strString, " ")
    6. MsgBox arrString(1)
    7. End Sub

  4. #4
    KING BODWAD XXI BodwadUK's Avatar
    Join Date
    Aug 2002
    Location
    Nottingham
    Posts
    2,176

    Re: error in len(...)

    This probably isnt relevant but just in case

    Split isnt in VB5 its only in VB6
    If you dribble then you are as mad as me

    Lost World Creations Website (XBOX Indie games)
    Lene Marlin

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2005
    Posts
    14

    Re: error in len(...)

    thanks for the replys guys
    the hello lol was just an example really, in the program strings are of different length.
    Right(bla, Len(bla) - 6) worked fine thanks alot

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