autonoob Posted August 29, 2007 Posted August 29, 2007 Hi all, I am a total noob with auto it, but I am trying to write a function to remove characters from the given string, ie "DD/MM/YYYY HH:MM:SS" to "DDMMYYYY HHMM" The "DD/MM/YYYY HH:MM:SS" is pull from a text file and used earlier in my script as $datetime, but i need to reuse the same date/time but in the different format later on. I am not to sure how to about this, any help would be great. Thanks!
silvano Posted August 29, 2007 Posted August 29, 2007 like this? $a = "HH:MM:SS" $b = StringReplace($a,":","") MsgBox(0,"",$B)
autonoob Posted August 29, 2007 Author Posted August 29, 2007 like this? $a = "HH:MM:SS" $b = StringReplace($a,":","") MsgBox(0,"",$B) how do i get it to chop of the last 2 characters? ie DDMMYYYY HHMM
jokke Posted August 29, 2007 Posted August 29, 2007 stringmid / stringleft / srtingright are good options UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
silvano Posted August 29, 2007 Posted August 29, 2007 $a = "DD/MM/YYYY HH:MM:SS" $b = StringReplace($a,":","") $c = StringReplace($b,"/","") MsgBox(0,"",$c) $d = StringTrimRight($c,2) MsgBox(0,"",$d)
autonoob Posted August 29, 2007 Author Posted August 29, 2007 $a = "DD/MM/YYYY HH:MM:SS" $b = StringReplace($a,":","") $c = StringReplace($b,"/","") MsgBox(0,"",$c) $d = StringTrimRight($c,2) MsgBox(0,"",$d) wow tirm, thats a new one to me, thanks!
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