mozart90 Posted December 27, 2006 Share Posted December 27, 2006 (edited) Hi, I've got a string and I would like to use it as a file name. Unfortunatly there are often forbidden charaters in these strings like * or /. (OS is win XP) I didn't find anything to this topic in the forum. I want to be sure to get a valid file name, so forbidden characters should be exchanged with a _ or something like that Is there a UDF? Is it clever to write this with regexp ? Greetings mozart90 Edited December 27, 2006 by mozart90 Easy Zip Compression using XP Link to comment Share on other sites More sharing options...
NeoFoX Posted December 27, 2006 Share Posted December 27, 2006 StringReplace() ?? Neo [center][font="Arial"]--- The Neo and Only --- [/font][font="Arial"]--Projects---[/font]Image to Text converterText to ASCII converter[/center] Link to comment Share on other sites More sharing options...
Xenobiologist Posted December 27, 2006 Share Posted December 27, 2006 Hi, Global $a = "theword.toCheck" $return = StringRegExp($a, "^[A-Za-z0-9_ -\.]+$", 0) If @error <> 0 Then MsgBox(64, "Something is wrong", "Damn :-)") If $return Then MsgBox(64, "Info", "No bad char found") Else MsgBox(16, "Info", "Bad char found") EndIf So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now