+ 3
Remove duplicate words from string
I shall remove duplicate words in the string given with a few conditions (from original task): "leaving only single (first) words entries. By word we shall mean the unit that consists only of latin alphabet characters. Only following punctuation marks (. , ! ? - : ; ) and space characters can be delimiters between words". The solution would be presented without using LINQ. Ive implemented two algorithms wasnt work right: 1) based clearly on char iteration and string.Replace(); 2) Replace() + regex. I just have idea 😞
5 ответов
+ 4
Well, it became much easier to solve just ive posted this 🧐. The solution is the following code:
https://code.sololearn.com/cahthLpb0lEF/?ref=app
+ 4
sneeze you remarks are welcome ☺️
+ 4
Well done. This totally meets the requirements.
One thing that can be improved.
At the moment some how the word "big" is replaces with " " (3 spaces)
Have not been able to address where this goes wrong.
Because you do replace big with "" (no spaces) in the function
Simply remove every second space
Or have a look why the 3 spaces are there
+ 4
sneeze ok, thanks ☺️
+ 3
Please share the code you already have made. Please use the playground.
What do you mean with "wasnt work right"
It was not accepted by the teacher or the result did not meet the requirements ?