Windows Develop Bookmark and Share   
 index > Windows Forms General > searching a rtb for a complete word
 

searching a rtb for a complete word

Hi, i have written what is basically a word processor and i want it to seach for a complete word which is held in a variable and return its start position.

I thought i had it, i load the text in and search it with instrev (as i need a backward search).

Anyway, lets say my variable is "10101"

when i search it returns the start place of "101" and ignores the rest of the string?

why, if i am asking for the complete string does it consider itself finished when it finds a partial match?

Is there some way of making it continue to search for the complete word?

I suspect the answer in in using the len function to make sure the returned string is the same length as the requested string but a cannot believe that there is not something such as... ("10101") telling the program to treat within the brackets as a complete word.

As you can probably tell i am fairly new to programming but enjoying all the challenges i come across, I just can't seem to find a simple answer to this one and i am sure it must be out there somewhere?

I am using a vista laptop and visual studio 2008 for .net programming

Clint.
  • Moved byOmegaManMVPThursday, April 30, 2009 9:24 PM (From:Regular Expressions)
  •  
grace quirrell  Monday, April 20, 2009 2:13 PM

I could not reproduce the malfunction (partial matching) of InStrRev.

The following prints zero, as it should, because the full pattern does not occur in the text.

Debug.WriteLine(InStrRev("Test101Test", "10101"))

Please provide an example that demonstrates the problem.

BinaryCoder  Friday, May 01, 2009 12:41 AM

You can use google to search for other answers

Custom Search

More Threads

• Open Source Code
• Dual Display Issues Using Vista
• FindWindow & ShowWindow API
• How to compare and hilight text in DataGridView?
• Custom TreeView Control in Windows Forms
• Capture a snapshot from Windows Media Control?
• get rid of the treeview horizontal scrollbar
• Console in a WinForm?
• using different languages in the CLR
• How do I convert a .gif image into Icon?