0

I am facing a text issue in my wpf application. User can enter some text in the textbox for ex: TAB1B0/TAB1B0. The second string is with some formatting(copied from excel).

I have to remove this formatting and show the text as TAB1B0. I am not suppose to change the special characters for ex é,ö.

I have to retain the cutlture specific words.

Anybody has idea how we achieve that ?

please share you thoughts.

  • 1
    What kind of textbox are you using, RichText? – Mark Jansen Sep 21 '15 at 13:40
  • This isn't *formatting*, these are *different* Unicode characters. A TextBox doesn't recognize any formatting. How were these characters generated? Excel doesn't substitute characters when you format something. Some user macro changed the original characters with other glyphs – Panagiotis Kanavos Sep 21 '15 at 13:43
  • 1
    FWIW, [This site](http://www.babelstone.co.uk/Unicode/whatisit.html) describes the characters above as (for example) "FULLWIDTH LATIN CAPITAL LETTER T" - that's what led me to the duplicate question. A [quick test](http://imgur.com/eEoP55h) in LINQPad appears to show that this is the issue. – James Thorpe Sep 21 '15 at 13:45
  • @JamesThorpe forgot the `FormKC` flag while testing, Normalize solves this indeed. In which case the OP could simply trim anything that comes after `/`. Or the input could be normalized, split on `/` and the two parts should be checked for equality – Panagiotis Kanavos Sep 21 '15 at 13:48
  • @PanagiotisKanavos Yeah it's a bit unclear as to the final goal - the fact it says "The second string" indicates that perhaps "TAB1B0/TAB1B0" is an example of two different forms that the string might take - I don't think it actually appears exactly like that, hence my thinking that the suggested dupe is a suitable target. – James Thorpe Sep 21 '15 at 13:52
  • Thanks for the suggestions. I have solved the issue with the FormKC Flag. – user2377549 Sep 22 '15 at 06:26

0 Answers0