Adobe Community
All community
This category
This board
Knowledge base
Users
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results forÂ
ShowÂ
 onlyÂ
|
Search instead forÂ
Did you mean:Â
Global community
Language:
Deutsch
English
Español
Français
Português
日本語コミュニティ
Dedicated community for Japanese speakers
í•œêµ ì»¤ë®¤ë‹ˆí‹°
Dedicated community for Korean speakers
Sign In
Exit
Home
ColdFusion
Discussions
delete spaces
Home
ColdFusion
Discussions
delete spaces
0
Upvote
delete spaces
Guest
/t5/coldfusion-discussions/delete-spaces/td-p/551513
May 31, 2007
May 31, 2007
Copy link to clipboard
Copied
Hi i have a string of text and numbers which i want to insert into a table colum
(ApID)
values
('#ClubID##First##Sur##Phone#')
but i need to remove any spaces that may occur how can i do this inside the insert query?
TOPICS
Advanced techniques
Views
430
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
6 Replies
6
Jump to latest reply
cf_dev2
Guide
,
/t5/coldfusion-discussions/delete-spaces/m-p/551514#M50587
May 31, 2007
May 31, 2007
Copy link to clipboard
Copied
Look at the Replace function
#Replace(variableName, " ", "", "all")#
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guest
AUTHOR
/t5/coldfusion-discussions/delete-spaces/m-p/551515#M50588
May 31, 2007
May 31, 2007
Copy link to clipboard
Copied
In Response To cf_dev2
ok thanks i have
<cfset first = #Replace(firstName, " ", "", "all")# >
<cfset sec = #Replace(surName, " ", "", "all")# >
<cfset all = #show.id#show.phone##first##sec# >
but i think i am getting a carrage return somehere, so what i now need is to remove any - & / \ charicters and any spaces and any carrage returns so i get a nice alpha numeric value.
how can i do this?
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
cf_dev2
Guide
,
/t5/coldfusion-discussions/delete-spaces/m-p/551517#M50590
May 31, 2007
May 31, 2007
Copy link to clipboard
Copied
In Response To Deleted User
... or if you want only alpha-numeric values, try RegExReplace(). I don't know the exact syntax offhand. Something like
#reReplaceNoCase(theString, "[^0-9,a-z]", "", "all")#
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guest
AUTHOR
/t5/coldfusion-discussions/delete-spaces/m-p/551518#M50591
Jun 05, 2007
Jun 05, 2007
Copy link to clipboard
Copied
In Response To cf_dev2
ok thanks i am using
#reReplaceNoCase(getit.ClubID, "[^0-9,a-z]", "", "all")#
but how do i add 4 columns as the string?
ie i have clubid, firstname, surname, phone which i want to add as a string
do i just use a comma between each?
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Dan_Bracuk
LEGEND
,
/t5/coldfusion-discussions/delete-spaces/m-p/551516#M50589
May 31, 2007
May 31, 2007
Copy link to clipboard
Copied
The chr() function will help you. You have to put the ascii value of the carraige return inside the brackets. Google is your freind.
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
cf_dev2
Guide
,
/t5/coldfusion-discussions/delete-spaces/m-p/551519#M50592
Jun 05, 2007
Jun 05, 2007
Copy link to clipboard
Copied
LATEST
> do i just use a comma between each?
No.
>but how do i add 4 columns as the string?
Same way you did in your original example.
'#ClubID##First##Sur##Phone#'
Votes
0
Upvote
Translate
Translate
Report
Report
Follow
Report
More
Reply
Reply
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Post Reply
Preview
Exit Preview
never-displayed
You must be signed in to add attachments
never-displayed
Â
Resources
Documentation
ColdFusion User Guide