-4

I have 2 richTextBoxes. The user has to type text to richTextBox2 from richTextBox1. When this is done, I want to do a correction, which shows (highlights for example) the different words, double spaces etc. I need to do this with words, because one wrong word equals one mistake.

Thank you in advance!

gyaka
  • 9
  • 2
  • Please expand RTBs. I guess you mean RichTextBox . – Alex Blokha Apr 23 '16 at 13:19
  • 4
    That's *way* too broad. Because i. First of all, there are tons of situations you will need to handle: more words in the second RTB than the first one, less words, single word, blank text, * text, awful spacing.. ii. Secondly, you show no research effort. iii. You can't expect such a fully working solution in here.. :) – Fᴀʀʜᴀɴ Aɴᴀᴍ Apr 23 '16 at 13:24
  • So yeah, it's way too complex for a beginner to do... and sorry. – gyaka Apr 23 '16 at 13:33
  • You haven't asked a question. You've asked the SO community to do your homework for you. Which specific tasks are you unable to do, and what have you tried so far? I would advise that you look at this: http://stackoverflow.com/help/how-to-ask – James R Apr 23 '16 at 14:17

2 Answers2

0
String[] words = str.split(" "); 

will get you all of the words that are seperated by a space and put them in an array of Strings. then you can go over that array and check every word individually.

is this what you are looking for? more info on str.split(char c)

Donat Pants
  • 379
  • 4
  • 11
0

If you want to find different words you can use diffplex library. You will need to implement words highlights.

For a list of possible solutions, you can look here

Word by word diff comparison of two strings in .NET

Community
  • 1
  • 1
Alex Blokha
  • 1,141
  • 2
  • 17
  • 30