Mar 4, 2005 #1 Horowitz Programmer Jan 29, 2005 30 GR Well, I write: textbox1.text.replace("hi","hello") but nothing happens. I suppose that it will work like below: Textbox1.text: After replacement: hi hello HI hello 'not case sensitive high hellogh Any "support" for this easy ...thing? Tnx
Well, I write: textbox1.text.replace("hi","hello") but nothing happens. I suppose that it will work like below: Textbox1.text: After replacement: hi hello HI hello 'not case sensitive high hellogh Any "support" for this easy ...thing? Tnx
Mar 4, 2005 #2 JohnYingling Programmer Mar 24, 2001 3,742 US textbox1.text is a function of tghe TextBox Class that returns a string. Replace is a Function of the String class. Try textbox1.text = textbox1.text.replace("hi","hello") http://www.VBCompare.com Compare Code Upvote 0 Downvote
textbox1.text is a function of tghe TextBox Class that returns a string. Replace is a Function of the String class. Try textbox1.text = textbox1.text.replace("hi","hello") http://www.VBCompare.com Compare Code
Mar 4, 2005 #3 dalchri Programmer Apr 19, 2002 608 US The replace method does not act on the string it is invoked on but rather returns a new string base on the string it is invoked on as input. So you need to do this: textbox1.text = textbox1.text.replace("hi","hello") Upvote 0 Downvote
The replace method does not act on the string it is invoked on but rather returns a new string base on the string it is invoked on as input. So you need to do this: textbox1.text = textbox1.text.replace("hi","hello")
Mar 4, 2005 #4 vladk Programmer May 1, 2001 991 US Dim RegX Dim SearchPattern, ReplacedText Set RegX = NEW RegExp SearchPattern = "hi" RegX.Pattern = SearchPattern RegX.Global = True textbox1.text = RegX.Replace(textbox1.text, "hello") Upvote 0 Downvote
Dim RegX Dim SearchPattern, ReplacedText Set RegX = NEW RegExp SearchPattern = "hi" RegX.Pattern = SearchPattern RegX.Global = True textbox1.text = RegX.Replace(textbox1.text, "hello")