  | | | Trimming strings | Trimming strings 2004-04-02 - By Dan Yargici
Back Use 'Split' and take the first object in your array.
MyString = "Iguessitstimetosplit.tga" MyArray = Split(MyString, ".", -1, 1) CleanFilename = MyArray(0)
Returns "Iguessitstimetosplit"
I guess it's almost the same for Jscript.
DAN
-- -- Original Message -- -- From: "Bernard Lebel" <atyss4si@(protected)> To: <XSI@(protected)> Sent: Friday, April 02, 2004 6:45 PM 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 > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1"> <META content="MSHTML 6.00.2800.1400" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY> <DIV><FONT face=Arial size=2>Use 'Split' and take the first object in your array.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial color=#0000ff size=2>MyString = "Iguessitstimetosplit.tga"</FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2>MyArray = Split(MyString, ".", -1, 1)</FONT></DIV> <DIV><FONT face=Arial color=#0000ff size=2>CleanFilename = MyArray(0)</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Returns "Iguessitstimetosplit"</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>I guess it's almost the same for Jscript.</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>DAN</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>-- -- Original Message -- -- </FONT> <DIV><FONT face=Arial size=2>From: "Bernard Lebel" <</FONT><A href="mailto:atyss4si@(protected)"><FONT face=Arial size=2>atyss4si@(protected)</FONT></A><FONT face=Arial size=2>></FONT></DIV> <DIV><FONT face=Arial size=2>To: <</FONT><A href="mailto:XSI@(protected)"><FONT face=Arial size=2>XSI@(protected)</FONT></A><FONT face=Arial size=2>></FONT></DIV> <DIV><FONT face=Arial size=2>Sent: Friday, April 02, 2004 6:45 PM</FONT></DIV> <DIV><FONT face=Arial size=2>Subject: [Script] Trimming strings</FONT></DIV></DIV> <DIV><FONT face=Arial><BR><FONT size=2></FONT></FONT></DIV><FONT face=Arial size=2>> Hello,<BR>> <BR>> Is there are way to trim an string? For instance, I'm getting a file name. I<BR>> would like to compare this name with other file names, but without the<BR>> padding and extension (basically to check if there are sequences of<BR>> different name in the same folder). The problem is that when you get the<BR>> file name of a file through FileSystemObject, you get the padding and<BR>> extensions as well.<BR>> <BR>> Thanks for any info<BR>> Bernard<BR>> ---<BR>> Unsubscribe? Mail </FONT><A href="mailto:Majordomo@(protected)"><FONT face=Arial size=2>Majordomo@(protected)</FONT></A><FONT face=Arial size=2> with the following text in body:<BR>> unsubscribe xsi<BR>> </FONT></BODY></HTML>
|
|
 |