iceangel89 Posted February 28, 2008 Posted February 28, 2008 how do i remove characters like at the end with VBS? i am trying to get the string of the filename without the extension
IcemanND Posted February 28, 2008 Posted February 28, 2008 Right(string,y) function to get the right side of string to len yLeft(string,y) to get the left side of string for len yMid(string, x, [len y]) to get substring from the point x to len y, if y is omitted go to end of string.
iceangel89 Posted February 28, 2008 Author Posted February 28, 2008 oh ya thanks, didn't think abt this, usually in many programming languages there is a substring function lol
Scr1ptW1zard Posted February 28, 2008 Posted February 28, 2008 You may want to look at using the FileSystem Object for your purpose here.You can see an example here:http://www.devguru.com/technologies/vbscri...etbasename.html
gunsmokingman Posted February 28, 2008 Posted February 28, 2008 You could also use the Split method or Split and Replace methodsExample You have this pathC:\SomeFolder\Folder\Name.ExtExample SplitDim F1, F2, F3F1 = Split("C:\SomeFolder\Folder\Name.Ext","\") For Each F2 In F1 F3 = F2 Next F1 = Split(F3,".") WScript.Echo F1(0) & vbCrLf & F1(1)Example Split And ReplaceDim F1, F2, F3F1 = Split("C:\SomeFolder\Folder\Name.Ext","\") For Each F2 In F1 F3 = Replace(F2,".Ext","") Next WScript.Echo F3
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