Replies: 1 comment 5 replies
-
You don't need to call ToString. You can get the characters just by indexing into the SourceText instance. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a very simple analyzer1 for checking if a source code line is too long (i.e. >183 characters).
and now I wonder how to get
string
fromTextLine
. Currently, I callstring lineString = line.Text.ToString();
but it's very suspicious to me. I don't believe it's correct performance-wise. How does one getstring
fromTextLine
correctly?I don't strive for excellent performance but I would like to avoid unnecessary allocations if possible.
Footnotes
Original code is from StackOverflow. ↩
Beta Was this translation helpful? Give feedback.
All reactions