How do I remove

Hi,
I'm writing a small application for an assignment that downloads a text file. The downloaded file is converted to a string but contains carriage returns(\r) and linefeeds(\n) that I need to get rid of.
People have mentioned regular expressions to me but I am unsure of how to use them and don't know if they apply to J2ME.
I was wondering if someone could point me in the right direction as to the best way to remove the "\r\n".
Any help would be greatly appreciated.
Thanks.

Well, if you have multiple strings with \r\n on the end, .trim() will help.
Another way is to simple remove the \r\n when you read your data:
1 read a block of data
2 if \r\n in block, copy everything before to string, and make every thing after the \r\n the new block
3 do until no \r\n
4 return to 1

Similar Messages

  • How can I remove my account on an iPad and add an existing one

    how can I remove my account on an iPad and add an existing one

    Or, how can I change the account on an existing iPad without restoring / formatting it?

  • How do i remove an e-mail mailbox from my iPad (leaving one behind)?

    How do I remove an e-mail mailbox from my iPad, as it appears to be causing problems with an nhs.net account?

    You can deactivate an email account in Settings > Mail, Contacts, Calendars > the account > Account. Turn it OFF.

  • How do i remove money from 1 itunes account to another ?

    How Do I Remove Money From One Itunes Account To Another ?

    See:  More Like This    To the right -->

  • I've had three laptops all connected to my itunes account, one was stolen, the other broke, how can I remove them from my itunes account?

    So, in three years, after getting an iphone and an apple account I've had to replace a laptop twice due to theft or damage. When I link my phone to my new computer, it asks me if I want to connect the computer with the phone and I say yes, but you can only have 5 devices connected to one account, since one was stolen, and the other laptop broke, how do I remove them from my account??

    De-authorise all, then authorise the one you still have.

  • How can I remove LABELS from my gmail account?

    How can I remove unwanted LABELS from the side bar unsung gmail?

    I assume you're using GMail as your primary e-mail account?  Try this.  This is how I am setup.  Not only will it move all your contacts to your phone but any changes made in GMail or on the iPhone will be sync'd with the server.
    http://www.google.com/support/mobile/bin/answer.py?answer=138740
    Note... I think this will delete your existing contacts from your device.  You will want to use iTunes to back them up and get them imported into GMail before you sync your device wtih GMail.

  • How can we remove the following zeros from quantity field ?

    Hi All.
    how can we remove the following zeros from quantity field while populating ALV by using FM REUSE_ALV_GRID_DISPLAY ?
    eg:getting output zqty = 2.000
    but i need           zqty = 2.
    help me to reslove this issue.
    Regards.
    jay

    Hi,
      While populating the field catlog do the following thing to   avoid zeros.
      wa_fieldcat-tabname = 'I_OUTPUT'.    " Curr
      wa_fieldcat-fieldname = 'FWAER'.
      wa_fieldcat-seltext_l = text-023.
      wa_fieldcat-no_zero = 'X'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR  wa_fieldcat.
    Thanks,
    Khushbu.

  • How can we remove asterix from the amount

    i have problem wen i am trying to get amount it uis coming in this manner
    ***100000**
    how can i remove it
    pls let me know

    Here is one logic:
    data text type string.
    text = '**1000**'.
    replace all occurrences of '*' in text with ''.
    write text.
    Check out this link too:
    do not want asterix to be padded in left of currency value..
    Hope it helps you.

  • How do I remove credit card info from iTunes Store account?

    How do I remove credit card information from my iTunes account?

    On your computer's iTunes you should be able to edit your payment info by going into the Store > View Account menu option and logging into your account, and on your account's details page there should be a payment link.  If you are doing it on an iOS device (iPad, iPhone or iPod Touch) then you could try tapping on your id in Settings > Store (Settings > iTunes & App Store on iOS 6+) and selecting 'View Apple ID' on the popup - that should also give you a payments link on your account's page.
    Changing payment info : http://support.apple.com/kb/HT1918

  • How do I remove credit card information from iTunes account?

    How do I remove credit card information from iTunes account?

    If you have an unpaid balance or payment due, you can't select None as your payment type.
    To see which order you need to pay for, view your purchase history.
    When you sign in to the store, you may see a message that there was a billing issue with your last order.
    Click the Billing Info button to see the order.

  • HT4623 how do I remove credit card from information can't download or update anymore

    how do I remove credit card from information can't download or update anymore

    Open iTunes on your computer, click on your Apple ID and log in with your password. Edit your payment information.

  • How can we remove the key from the dataset which has json

    uid
    id
    Json
    4588
    51
    { "key": "1/0/234", "element1":{ "a":10 "b": "test1" } }
    4589
    52
    { "key": "1/0/234", "element1":{ "a":10 "b": "test1" } }
    4590
    53
    { "key": "1/0/234", "element1":{ "a":10 "b": "test1" } }
    I have the above dataset resulting from merge operation .
    UID -Integer data type
    ID- Integer data type
    Json- String data type holding json document
    How can I remove  the " key" element from the json field  and make my dataset look like 
    Expected output which will strip of key value pair from the json column
    uid
    id
    Json
    4588
    51
    { "element1":{ "a":10 "b": "test1" } }
    4589
    52
    { "element1":{ "a":10 "b": "test1" } }
    4590
    53
    { "element1":{ "a":10 "b": "test1" } }
    Mudassar

    Hello Mudassar,
    In SQL Server / T-SQL we don't have a native JSON support, so you would have to implement a solution on your own = parsing the string and remove the "Key" + it's value.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How can we remove the commas from the Formula value in SAP BW BEx query

    Hi All,
    How can we remove the commas from the Formula value in SAP BW BEx query
    We are using the formula replacing with characteristic.The characteristic value needs to be display as number with out commas.
    Regards
    Venkat.

    Do you want to remove the commas when you run the query on Bex Web or in RSRT?
    Regards

  • How can i remove a card from iTunes ?

    How can i remove a card from iTunes ?

    If you want to remove a credit/debit card from your account then on your computer's iTunes you should be able to edit your payment info by going into the Store > View Account menu option and logging into your account, and on your account's details page there should be a payment link.  If you are doing it on your iOS device then tap on your id in Settings > iTunes & App Store and tap on 'View Apple ID' on the popup and log into your account  - that should also give you a payments link on your account's page.
    Changing payment info : Change or remove your payment information from your iTunes Store account (Apple ID)
    If you don't get the 'none' option on the payment details screen : Why can’t I select None when I edit my Apple ID payment information?

  • How do you remove credit card from apple store ios7

    How Do You Remove Credit Card From Apple Store With IOS7

    After establishing the Credit Card account (i.e. after you have made purchases), you can remove the credit card information by editing your payment info, choosing "None".
    Settings>iTunes and App Stores>Apple ID>View Apple ID>Sign-in>Payment Information

  • How do you remove credit card # from iTunes account

    How do you remove credit card # from iTunes account without entering a new one because added money to account from gift card?

    On your computer's iTunes you should be able to edit your payment info by going into the Store > View Account menu option and logging into your account, and on your account's details page there should be a payment link.  If you are doing it on your iPhone then try tapping on your id in Settings > iTunes & App Store and select 'View Apple ID' on the popup - that should also give you a payments link on your account's page.
    Changing payment info : http://support.apple.com/kb/HT1918

Maybe you are looking for

  • Apps' content in Chinese despite correct region set

    Hi Guys! Let me start off by saying this is my first post and I've just set up an account with sole intention to seek advice. I really hardly ever register onto online boards where I have not contributed previously and start up threads that junk it u

  • Cry for help: build 9926 windows update errors: 0x80240438 0x80244019

    lately  I'm stuck with build 9926 when I check for updates it works,  and it even downloads some updates according to the logs but, that's about it ,  it's not updating anything. tried all the solutions on the internet I synced with the appstore.  bu

  • How to reset firefox profile if it crashes on start (also safe mode)

    Hello, I need to know how to make Firefox do a profile reset when it crashes on start even in safe mode. It starts fine with a new profile. I had this before today, and then after the 3rd crash report send, a popup offered me a solution to reset my p

  • Uploading photos to online print companies

    I upload lots of photos for printing from iPhoto to various online printing companies, mainly photo box. They use an aurigma uploader. I have installed Lion  and despite having reinstalling the java as requested I can no longer drag and drop files in

  • How to use addPasswordToPasswordHistory method

    Hi Can some one please tell me how to use the method addPasswordToPasswordHistory from the class WSUser.I have a requirement to add user password to password history whenever user changes his password through my custom password change workflow.Custom