我有一个文本框,用户可以在其中使用脚本语言编辑文本。我已经想出了如何让用户一键注释掉行,但似乎无法正确地取消注释。例如,如果文本框中有:
所以,当用户选择任意文本并决定取消注释时,具有"--"的行的开头将被删除。没有"--"的行应该不受影响。简而言之,我想要一个类似于Visual Studio中的取消注释功能。有什么方法可以实现这个功能吗?Normal Text is here More normal text -- Commented text -- More commented text Normal Text again --Commented Text Again
谢谢。