Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Related Rants
The moment you realize the .net Framework's String.TrimEnd() method will actually modify your String prior to returning it, and there seems to be no convenient way of getting a copy without declaring a new variable...
Just wanted to get rid of excess empty lines in the log caused by trailing <CR><LF> when receiving lines of serial data:
Console.WriteLine(DateTime.Now.ToString("H:m:s.fff") + " - serial data received on " + com_port + ": " + serial_data.TrimEnd())
But suddenly the parser could not find its termination characters anymore...
Resulting in probably the most disgusting parentheses I had ever added to any code:
Console.WriteLine(DateTime.Now.ToString("H:m:s.fff") + " - serial data received on " + com_port + (": " + serial_data).TrimEnd())
Yes, I feel bad about it, but then again is VB .net and it kinda "works for me". I promise I will (try to remember to) remove these as soon as debugging is done...
devrant
string
.net
vb