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!

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.