Link to home
Start Free TrialLog in
Avatar of fredmastro
fredmastroFlag for United States of America

asked on

Easy, whats VB Constant for Space?

Easy, whats the VBConstant or equivlent of a space?
Like vbCrLf is for Carriage return–linefeed combination.

Whats the one for a 's p a c e'?
Avatar of ruperts
ruperts

char(32)

Have nice day!

ok...

chr(32)

I got carried away in the excitement!
Avatar of fredmastro

ASKER

ack I knew that, whats the vb string for that? So I can use the Replace command.

Replace(Text32,????," ")

I tried (Text32,char(32)," ") doesn't like it.
lol
Not sure if it's related but I get a :

Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'Replace'


error now.
That my code.

Text=Replace(News("News"),vbCrLf,"<BR>")

Text=Replace(News("News"),chr(32),"&nbsp;")
ASKER CERTIFIED SOLUTION
Avatar of ruperts
ruperts

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
maybe there's a trick to using two replace statments? Works fine one of them, I get error with two.
Ahh got it thanks

Text=Replace(News("News"),vbCrLf,"<BR>")
      
Text=Replace(Text,chr(32),"&nbsp;")
ok - a result at last..

(although have you checked that you can pass a NULL value to the replace function?)
.......................................
And finally you can use the asc(character) function to find out any character value but you probally knew that anyway!