Raised This Month: $ Target: $400
 0% 

function for safe filenames?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-21-2007 , 23:24   Re: function for safe filenames?
Reply With Quote #7

"| | !" doesn't work
"| |" works

What's the difference? The exclamation mark. So replace your exclamation mark with an underscore as well. I'd just make a function like this, if it's for demos. It converts anything that isn't a letter or number to an underscore.

Code:
stock convert_to_alnum(string[]) {      new len = strlen(string), i;      for(i=0;i<len;i++)      {           if(!isalnum(string[i]))                string[i] = '_';      } }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
 



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 04:54.


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