Raised This Month: $ Target: $400
 0% 

Removing ',",[,],~.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 02-07-2005 , 18:42   Removing ',",[,],~.
Reply With Quote #1

How would you replace a get_user_name from -Snort- 'Woot' Leader to Snort Woot Leader (Because I'm having problems doing stuff when my name has random symbols like that...I.E. my name wont register to my MYSQL database, but when it is something as simple as Ben Dover, it works....)

heres some chars I would like to know how to remove also...

',",[,],~,-,=,/,\, and anything else of that nature.
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 02-07-2005 , 19:38  
Reply With Quote #2

Use the replace command.
__________________
Anything that is done can only be done better by urself - since life is a opinion make it the way urs feel its best

~live by it
Da Bishop is offline
Send a message via MSN to Da Bishop
TotalNoobScripter
Senior Member
Join Date: Aug 2004
Old 02-07-2005 , 21:57  
Reply With Quote #3

Yea, but its treating me bad
TotalNoobScripter is offline
Send a message via AIM to TotalNoobScripter
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 02-08-2005 , 06:49  
Reply With Quote #4

Try this:
Code:
stock remove_weird_stuff(text[]) {    new i;    new off=0;    new validcnt=0;    for (i = 0; text[i]; ++i)    {       text[i - off] = text[i];       if (text[i] == '\'' || text[i] == '\"' || text[i] == '[' || text[i] == ']' || text[i] == '~')          ++off;       else          ++validcnt;    }    text[validcnt] = 0; }

Note that this is untested, I have written it in one minute :X

EDIT: Typo
__________________
hello, i am pm
PM is offline
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 20:48.


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