PDA

View Full Version : remove the space when i get value from excel file


CstAn
05-25-2007, 06:01 PM
Dear all,

I really need your all help.

I has a excel import function, and will display out the value in each text box (col by col).

but if some of the fields got space, i cant removed the space;
for example:
in excel row 1 col A: _ _ 123; I want remove the space.

I try using str_replace and trim, also not work..

how can i do that?

iLLin
05-25-2007, 06:13 PM
Are they spaces or _ _ ?

CstAn
05-25-2007, 07:30 PM
Are they spaces or _ _ ?

spaces.....

not underscore......

CFMaBiSmAd
05-25-2007, 08:05 PM
I try using str_replace and trim, also not work..You would need to post your actual code to get help with it.

The trim() function is normally used for this. If you could not get it to work, either the characters are not what you think they are or you were applying the function incorrectly.