|
-
Mar 30th, 2006, 04:27 AM
#1
Thread Starter
Lively Member
add two strings without space
anybody can tell me how to add two strings without space between them
for example string1= string2 & string3
-
Mar 30th, 2006, 04:28 AM
#2
Frenzied Member
Re: add two strings without space
well what you have posted works just the way you want it
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Mar 30th, 2006, 04:35 AM
#3
Thread Starter
Lively Member
Re: add two strings without space
yes but in string1 it is a space between two strings(string1 and string2)
but i want it without space
-
Mar 30th, 2006, 04:37 AM
#4
Re: add two strings without space
That means there is a space at the start or end of one of your strings. Try:
VB Code:
string1= RTrim$(string2) & LTrim$(string3)
-
Mar 30th, 2006, 04:39 AM
#5
Frenzied Member
Re: add two strings without space
what do you mean? do you mean that there is a space in string 1
if you want no spaces then you can use
VB Code:
replace(string1," ", "")
replace(string2," ", "")
then do your code
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Mar 30th, 2006, 04:41 AM
#6
Thread Starter
Lively Member
Re: add two strings without space
many thanks you saved me!!!!!!!!
-
Mar 30th, 2006, 05:06 AM
#7
Re: add two strings without space

Don't forget to mark this thread resolved
-
Mar 30th, 2006, 06:41 AM
#8
Frenzied Member
Re: add two strings without space
 Originally Posted by d3gerald
what do you mean? do you mean that there is a space in string 1
if you want no spaces then you can use
VB Code:
replace(string1," ", "")
replace(string2," ", "")
then do your code
Just to add, you didn't have to do it twice if all you want is string1 without space:
VB Code:
string1 = Replace((string2 + string3), " ", "")
Also if this thread have been resovled place click on Thread Tools -> Mark Thread Resolved
-
Mar 30th, 2006, 06:42 AM
#9
Re: add two strings without space
wiz126 : nice, but instead of using + use & because if the variables are just numbers it will add those
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Mar 30th, 2006, 06:44 AM
#10
Re: add two strings without space
Not to critisize, but removing all spaces from a string might not be wise.
The spaces inside the string might be part of it (a sentence or something).
Best is to trim the spaces of the ends.
I code C#....

-
Mar 30th, 2006, 06:45 AM
#11
Re: add two strings without space
 Originally Posted by ganeshmoorthy
wiz126 : nice, but instead of using + use & because if the variables are just numbers it will add those
point to be noted...
__________________
________________0îîî___
___îîî0________(___)____
__(___)_________) _/_____
___\_ (_________(_/______
____\_)_________________
-
Mar 30th, 2006, 06:57 AM
#12
Hyperactive Member
Re: add two strings without space
VB Code:
string1 = Trim(string2) & Trim(string3)
-
Mar 30th, 2006, 07:24 AM
#13
Re: add two strings without space
 Originally Posted by Datacide
VB Code:
string1 = Trim(string2) & Trim(string3)
He may not want to remove the leading spaces of string2 or the trailing spaces of string3.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|