Results 1 to 3 of 3

Thread: Formatting a string

  1. #1

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Formatting a string

    What's the best way to format a string so that everything before the last "\" is deleted?

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Code:
        
            Dim strTemp As String
            Dim intStart As Integer = 0
            strTemp = TextBox1.Text
            intStart = strTemp.LastIndexOf("\")
            MessageBox.Show(strTemp.Substring(intStart + 1))

  3. #3
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    VB Code:
    1. MessageBox.Show(s.Substring(s.LastIndexOf("\") + 1, s.Length - s.LastIndexOf("\") - 1))

    yes im a snot

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