Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 in C# \n suposed to be coloured?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Jynks
New Member

4 Posts

Posted - Dec 01 2018 :  7:53:39 PM  Show Profile  Reply with Quote
Console.WriteLine("This is a test\nShould this line break be coloured?\nAs it would be a lot easier to read");

So in the above code.. all the \n stuff are coloured the same as the string itself. I was wondering is that is working as intended or if there is something wrong? If not.. is there a way ot make these things coloured?

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Dec 02 2018 :  08:18:21 AM  Show Profile  Reply with Quote
This is working as intended. Once you start looking at more complex escape sequences, let alone regular expressions, this quickly becomes a bit tricky.

Are you aware of literal strings in C#? You can replace this line with the code:

    Console.WriteLine(@"This is a test
Should this line break be coloured?
As it would be a lot easier to read");

which makes it a lot easier to read and edit, and is still valid code.

zen is the art of being at one with the two'ness
Go to Top of Page

Jynks
New Member

4 Posts

Posted - Dec 02 2018 :  8:33:55 PM  Show Profile  Reply with Quote
cool... yeah.. thanks I knew of that. Though you are right I am a beginner. I was just curious if it was supposed to be like that or if there was a error or something. As the / stuff was coloured in my last editing package is all.

Thanks for the reply.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Dec 03 2018 :  2:40:53 PM  Show Profile  Reply with Quote
It makes sense that some editors do this, but no, it's not something that either VA or the IDE tries to do.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000