Block Comment Being Closed By "*/" In String

433 Views Asked by At

This is a quality of life question that might be awfully simple, but, I cannot seem to find an answer for it.

If you start a block comment...

/*
my code here
string url = "lorumipsum....*/...lorumipsum"; <---this "*/" is closing the comment early
more code
*/

It gets closed by any "*/" in a string. Is there a way to escape this? Or do I just manually "//" the line and block comment the rest?

2

There are 2 best solutions below

0
On BEST ANSWER

You can select all text and comment from toolbar (Shortcut: Ctrl + K + U). It will add // in front of all selected lines like this.

///*
//my code here
//string url = "lorumipsum....*/...lorumipsum"; <---this "*/" is closing the         comment early
//more code
//*/

No need to do this manually.

Toolbar Image
enter image description here

2
On

Or, you can just hold down the Alt-key, click and draw across all lines that you would like to comment out and then just type // before them as you are in Multiline-Editmode.