wipped Posted July 10, 2009 Share Posted July 10, 2009 Hi i need to delete a little part of a text help me example: the text is: text1- text2- text3- i want to delete: text2- how can i do that pls help P.S. the text is in a .txt document Link to comment Share on other sites More sharing options...
Inverted Posted July 10, 2009 Share Posted July 10, 2009 (edited) You don't properly explain. If you want to delete a specific string use StringReplace and replace it with an empty string "" Edited July 10, 2009 by Inverted Link to comment Share on other sites More sharing options...
99ojo Posted July 10, 2009 Share Posted July 10, 2009 You don't properly explain. If you want to delete a specific string use StringReplace and replace it with an empty string ""Hi,have a look at _ReplaceStringInFile ;-))Stefan Link to comment Share on other sites More sharing options...
wipped Posted July 11, 2009 Author Share Posted July 11, 2009 Hi,have a look at _ReplaceStringInFile ;-))StefanThanks, i dont't understand stringreplace but _ReplaceStringInFile is understandable Link to comment Share on other sites More sharing options...
Bert Posted July 11, 2009 Share Posted July 11, 2009 Look at the example given in the helpfile: $text = StringReplace("this is a line of text", " ", "-") $numreplacements = @extended MsgBox(0, "New string is", $text) MsgBox(0, "The number of replacements done was", $numreplacements) Line 1 is using the command. It replaces " " (any spaces between words) with "-" (a hyphen) $numreplacements = @extended - The command returns the new string, and the number of replacements performed is stored in @extended. By running the command, the variable $text will be changed from "this is a line of text" to "this-is-a-line-of-text". You see this in the first message box. The second message box you see is the extended information. In this case the number "5" is returned for this is the number of times the " " was found and replaced. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
wipped Posted July 11, 2009 Author Share Posted July 11, 2009 Look at the example given in the helpfile: $text = StringReplace("this is a line of text", " ", "-") $numreplacements = @extended MsgBox(0, "New string is", $text) MsgBox(0, "The number of replacements done was", $numreplacements) Line 1 is using the command. It replaces " " (any spaces between words) with "-" (a hyphen) $numreplacements = @extended - The command returns the new string, and the number of replacements performed is stored in @extended. By running the command, the variable $text will be changed from "this is a line of text" to "this-is-a-line-of-text". You see this in the first message box. The second message box you see is the extended information. In this case the number "5" is returned for this is the number of times the " " was found and replaced. Yes okey But i want to replace text in a file so i think i better use _ReplaceStringInFile 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