  | | | Trimming strings | Trimming strings 2004-04-02 - By Graham D Clark
Back //function get filesnamepadframenumberextension //this could be simpler in a line, but seperated for clarity var string = "myfilename.0001.jpg" logmessage (string); //eg for name var mynameexp = new RegExp(/\w+/) var result = string.match(mynameexp) logmessage (result); //eg for pad var mynumexp = new RegExp(/\d{4}/) var result = string.match(mynumexp) logmessage (result); //eg for extension var result = string.match(/\w+$/) logmessage (result);
Filesystemobject also has methods for extension etc. -- ---- ---- ---- ---- ---- -- http://www.grahamdclark.com TD in circulation
> -- --Original Message-- -- > From: owner-xsi@(protected) > [mailto:owner-xsi@(protected)] On Behalf Of Bernard Lebel > Sent: April 2, 2004 3:46 PM > To: XSI@(protected) > Subject: [Script] Trimming strings > > > Hello, > > Is there are way to trim an string? For instance, I'm getting > a file name. I > would like to compare this name with other file names, but without the > padding and extension (basically to check if there are sequences of > different name in the same folder). The problem is that when > you get the > file name of a file through FileSystemObject, you get the padding and > extensions as well. > > Thanks for any info > Bernard > --- > Unsubscribe? Mail Majordomo@(protected) with the following > text in body: > unsubscribe xsi > > >
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|
 |