Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Block Comment Being Closed By "*/" In String

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?

like image 527
Max Avatar asked Aug 11 '26 11:08

Max


2 Answers

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

like image 59
Nikhil Agrawal Avatar answered Aug 13 '26 00:08

Nikhil Agrawal


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.

like image 31
M463 Avatar answered Aug 13 '26 00:08

M463



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!