How to test a string if it is separated with space or not?

Recommended Answers

All 6 Replies

dim x as string
x = "hello world"
if instr(1, x, " ") <> 0 then
     msgbox "yeah, space."
else
     msgbox "no sir!"
end if
commented: Thank you, here is good reputation for you. +1

Yup...
Nice and complete comatose.
I didn't want to do the guys homework so I replied with a ref to the function name only.

Not sure how you can report double posting since I'm new here but this is one is a repeat from nagatron.

see
http://www.daniweb.com/forums/thread179552.html

commented: You're so negative. +0

Bah :icon_eek:

Wish I would have caught that it was homework :/

Bah :icon_eek:

Wish I would have caught that it was homework :/

This is not a homework or assignment. It is a thesis program. I am making a reservation system and I want my the username and password should be no space in between. I won't post here if it is just an assignment. I am making a big system, after I finished it I will share this here and on planetsourcecode.com so anyone can have a look for reference.

Yup...
Nice and complete comatose.
I didn't want to do the guys homework so I replied with a ref to the function name only.

Not sure how you can report double posting since I'm new here but this is one is a repeat from nagatron.

see
http://www.daniweb.com/forums/thread179552.html

I am not doing homework man, just see as soon as I finished the system. I will not ask for help here anymore.

comatose, thank you for the information you gave me. I will include you as one of the contributor of the system. I will post it in there the zip file of the system as soon as I can. Thank you again. This thread is solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.