Copy empty string using Clipboard.SetText(string)

前端 未结 4 1304
感情败类
感情败类 2020-12-20 18:33

Clipboard.SetText(\"\") throws me an error - \"Value cannot be null\". So how do I copy an empty string using Clipboard.SetText?

I have alr

4条回答
  •  伪装坚强ぢ
    2020-12-20 19:15

    If you try to save null or an empty string using Clipboard.SetText it will never work.

    See Clipboard.SetText Method (String) (MSDN). It mentions ArgumentNullException is thrown if the text is null or Empty for Clipboard.SetText.

    Hence you cannot achieve what you are trying to achieve.

提交回复
热议问题