Results 1 to 6 of 6

Thread: String.TrimEnd() doesn't work

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2002
    Posts
    121

    String.TrimEnd() doesn't work

    the trim methods don't seem to work at all. has anyone used any of them?

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    post your code
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2002
    Posts
    121
    this is my code:
    Code:
    Dim MyString As String = "floorboards, "
            Dim MyChar As Char() = {"r"c, "o"c, "W"c, "l"c, "d"c, "!"c, " "c}
            Dim NewString As String = MyString.TrimEnd(MyChar)
            Console.WriteLine(NewString)

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    I just asked you to post the code so OTHER people can help you, cuz I'm very beginner.
    But I dont know why, that doesnt work. But you can use this instead

    Dim NewString As String = RTrim(MyChar)
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  5. #5
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Psychotron
    Code:
    Dim MyChar As Char() = {"r"c, "o"c, "W"c, "l"c, "d"c, "!"c, " "c}
    umm, what does the "c" mean in "r"c ?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  6. #6
    Addicted Member wolfofthenorth's Avatar
    Join Date
    Jan 2001
    Location
    Tatooine
    Posts
    169
    Trim End worked for me. Here is how I checked it.


    Dim MyString As String = "floorboards, "
    Dim MyChar As Char() = {"r"c, "o"c, "W"c, "l"c, "d"c, "!"c, " "c}

    MsgBox(MyString.Length)
    Dim NewString As String = MyString.TrimEnd(MyChar)
    MsgBox(NewString.Length)
    That which does not kill us, only makes us stronger.

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