-1

On my project I need to import from clipboard excel data.

But in case we have german chars like "ä ö ü" I need to replace:

clipboardText = Clipboard.GetText(TextDataFormat.Rtf);

clipboardText.Replace("\u252\'fc", "ü");

I got this error from compiler:

enter image description here

1 Answers1

4

Add an @ in front of the " :

clipboardText.Replace(@"\u252'fc", "ü");

Or double the \\ :

clipboardText.Replace("\\u252'fc", "ü");
  • 1
    I think the 2nd one has one too many slashes. This will evaluate the following two chunks and still error on the latter: () (\u252). Assuming his string is simple text with the characters \, u, 2, 5, and 2, then your 1st method should still work. – Mark Balhoff Aug 10 '21 at 20:10
  • Many thanks, i add the @ and it works fine – Remo Gwerder Aug 10 '21 at 21:57