954,557 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Split

Hi all,
How i can split a string that include spaces by "&" ?
I already used split function but there are problem with spaces.

thanks.

ITKnight
Light Poster
48 posts since Jan 2008
Reputation Points: 11
Solved Threads: 1
 

I use instr() , mid() , right() , and left()

WaltP
Posting Sage w/ dash of thyme
Moderator
10,507 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

Lets see your code .

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

Hi,
this part of code :

Arr1 = Split("aaa bbb&ccc ddd&eee",4)

it returns the values aaa ccc eee
ignored the values after the spaces.

Best Regards,
Thank You

ITKnight
Light Poster
48 posts since Jan 2008
Reputation Points: 11
Solved Threads: 1
 

See if this help :

Arr1 = Split("aaa bbb&ccc ddd&eee","&")
Jx_Man
Nearly a Senior Poster
3,329 posts since Nov 2007
Reputation Points: 1,372
Solved Threads: 444
 

Sorry, didn't remember there was a split command. Ignore my post

WaltP
Posting Sage w/ dash of thyme
Moderator
10,507 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

Why are you using the 4 in second parameter?
Did you mistype it?

Try simply

Arrl = Split("aaa bbb&ccc ddd&eee", "&")


It works fine for me.

And Msgbox Split("aaa bbb&ccc ddd&eee","&")(0) return "aaa bbb".

Regards,
SidneiHi,
this part of code :

Arr1 = Split("aaa bbb&ccc ddd&eee",4)

it returns the values aaa ccc eee
ignored the values after the spaces.

Best Regards,
Thank You

sidnei
Junior Poster in Training
55 posts since Dec 2009
Reputation Points: 22
Solved Threads: 10
 

Thanks guys, its working.

ITKnight
Light Poster
48 posts since Jan 2008
Reputation Points: 11
Solved Threads: 1
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: