Results 1 to 4 of 4
  1. #1
    BoomPony is offline Member
    Join Date
    Nov 2010
    Posts
    12
    Rep Power
    0

    Default getting rid of empty space at the end of a string

    Hi all,

    I'm sending UDP messages from server to client and they are a fixed size, so unless the message is max size, at the end of each message is a trail of empty spaces. This is a problem as I want to use the String Split function to seperate the message into different parts, and use Integer.ParseInt on these parts, but I can't use ParseInt on the last part as it contains loads of empty space at the end.

    How can I get just the characters that I need from the end string?

    Thanks x

  2. #2
    eRaaaa is offline Senior Member
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    787
    Rep Power
    6

  3. #3
    BoomPony is offline Member
    Join Date
    Nov 2010
    Posts
    12
    Rep Power
    0

    Default

    perfect thanks man

  4. #4
    codesmuggler is offline Member
    Join Date
    Feb 2011
    Posts
    30
    Rep Power
    0

Similar Threads

  1. how to repalce space with %20 in a string
    By Basit781 in forum CLDC and MIDP
    Replies: 4
    Last Post: 06-13-2012, 09:08 PM
  2. Replies: 3
    Last Post: 02-03-2011, 11:19 PM
  3. Replies: 1
    Last Post: 11-04-2010, 07:53 PM
  4. Problem with empty search string
    By virendra in forum Lucene
    Replies: 0
    Last Post: 01-06-2010, 11:42 AM
  5. NumberFormatException: empty String
    By svpriyan in forum New To Java
    Replies: 1
    Last Post: 08-12-2009, 11:46 AM

Posting Permissions

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