wipped Posted July 10, 2009 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
Inverted Posted July 10, 2009 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
99ojo Posted July 10, 2009 Posted July 10, 2009 On 7/10/2009 at 3:02 PM, 'Inverted said: 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
wipped Posted July 11, 2009 Author Posted July 11, 2009 On 7/10/2009 at 8:37 PM, '99ojo said: Hi,have a look at _ReplaceStringInFile ;-))StefanThanks, i dont't understand stringreplace but _ReplaceStringInFile is understandable
Bert Posted July 11, 2009 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/
wipped Posted July 11, 2009 Author Posted July 11, 2009 On 7/11/2009 at 1:57 PM, 'Volly said: 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
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