Raised This Month: $51 Target: $400
 12% 

Easiest/Most efficient way to strip characters from a string


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 05-26-2006 , 19:35   Easiest/Most efficient way to strip characters from a string
Reply With Quote #1

What is it? For example, if I have the string:

"is the bomb"

and I want to remove the " from the string (both of them), how would I go about doing this (no matter where they are in the string) ?

Thanks,
Josh
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-26-2006 , 19:41  
Reply With Quote #2

remove_quotes
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 05-26-2006 , 19:42  
Reply With Quote #3

LOL thats funny, is there another way though if it was a different character?
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-26-2006 , 19:44  
Reply With Quote #4

Quote:
Originally Posted by Geesu
LOL thats funny, is there another way though if it was a different character?
No, you just have to do something like replaceall(szString,len,"character","")
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 05-26-2006 , 19:45  
Reply With Quote #5

yea i tried that with the " and it left the last one on it lol
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-26-2006 , 19:52  
Reply With Quote #6

Quote:
Originally Posted by Geesu
yea i tried that with the " and it left the last one on it lol
Strange, check the stock and make sure it's not ending the iteration before the end of the loop.

Also, did you use "^"" as the replace string?
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 05-26-2006 , 19:53  
Reply With Quote #7

yes I did

"^""
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode