Jump to content

[SOLVED] Remove white space at end of variable


rhyspaterson

Recommended Posts

Hey guys,

 

I'm pulling some variables from our database using ODBC and all is fine. However, with two of my variables, i am getting a whole lot of white space at the end of them. This wasn't noticeable until i wrote the variables to my XML file as seen below:

 

<marker lat="111.11111111" lng="111.1111111" country="AU" city="Perth" company="Bob's High School                                                                                                 " ipAddress="203.14.53.46                                    " registrationID="10008" />

 

I have changed the lat/long and company name for security :P

 

But! As you can see, at the end of the company and ipAddress there is a large amount of white space. This only happens with these two variables. It hasn't got anything to do with the way i am writing them to the XML file as looking at the variables themselves yields the same results.

 

So i'm looking for a way or removing this white space. Maybe searching for the ending " and then going backwards until the ending letter, and deleting everything in between.. i'm not too sure where to go with this one.

 

Thanks for your help!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.