I was looking for the find and replace algorithm which editor softwares are using. for ex: notepad. when i search something and then when i replace it , how exactly it works. I am aware of rabin-karp and KMP algos. but i am wondering if they are most efficient ? and how do they replace it ? Seraching is okay, may be KMP can be applied, but replacing has some cases like when replaced words is of greater length and when it is of smaller length. Can you explain or give some link to it ? how will you shift whole text after that word in efficient way. thanks.
Jump to Post
I would use a temporary char array -- after you find the beginning of the string to be replaced copy the first part of the original string into the temp array, copy the replacement string into the temp buffer, then finally copy the remainder of the original string
Maybe a …
Jump to Post
I did some tinkering with the example of Range.Find in MSDN and got this to work. "Knee" was used a lot in the file I was working.
Private Sub FindAndReplace() Dim C As Range Dim FirstAddress As String With Worksheets(1).Range("a1:G40") Set C = .Find("Knee", LookIn:=xlValues) If …
All 10 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.