Results 1 to 5 of 5

Thread: Add string before a string...

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2007
    Posts
    520

    Add string before a string...

    So, i'm having a major brain fart...

    If I wanted to add a string AFTER a string, i could do string += "whatever"...

    How could I add it to BEFORE it?

  2. #2
    Lively Member therat324's Avatar
    Join Date
    Oct 2008
    Location
    Bethany, Oklahoma
    Posts
    94

    Re: Add string before a string...

    you could always try
    vb Code:
    1. originalString = newString & originalString
    My car if Chevy was VB.NET

    Code:
    Public Class MyCar
        Public Sub Camaro()
            Dim Camaro As Car
            Camaro = SS.Fast("Sexy")
        End Sub
    
        Public Function Fast(ByVal sexy As String ) As String
            Return "SUPER" & sexy
        End Function
    End Class

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2007
    Posts
    520

    Re: Add string before a string...

    i COULD do that, and I guess I should've specified more...


    actually... nevermind. you gave me an idea. thanks!

  4. #4
    Lively Member therat324's Avatar
    Join Date
    Oct 2008
    Location
    Bethany, Oklahoma
    Posts
    94

    Re: Add string before a string...

    Lol please share. Is there an operatorfor what you are trying to do
    My car if Chevy was VB.NET

    Code:
    Public Class MyCar
        Public Sub Camaro()
            Dim Camaro As Car
            Camaro = SS.Fast("Sexy")
        End Sub
    
        Public Function Fast(ByVal sexy As String ) As String
            Return "SUPER" & sexy
        End Function
    End Class

  5. #5
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Add string before a string...

    you could use the string's insert method:

    vb Code:
    1. Dim s As String = "string"
    2. MsgBox(s.Insert(0, "a "))

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