Some time ago, I saw a line number cleaning tool on cnblogs, but in the command line mode. I always wanted to create a UI style, so I did it when I had time last night, of course, we need to share it with you...
Several problems encountered when doing this software:
1.How can I remove a row number in an effective way.
The first thing I want to consider is to read each line and then remove the leading and trailing spaces and separate them with the first space after the line number. Then, I can take the following space, however, this method is too inefficient.
QueryMsdnFoundTrimstartMethod, but if there is a space in front of the row number, this will not work, So I later thought of adding an empty method in front. However, the disadvantage of using this method is that if the row number contains other characters defined at the end of programming, other characters cannot be removed (such.,And so on), which greatly reduces the flexibility. However, due to my limited capabilities, I can only add a text box on the interface to allow users to add other characters, so I hope you can give me more advice.
2.SetTextbox1After the content is convertedTextbox2.
First, I want to use a similarVBInsideCHR (10) + CHR (13)For line breaks, but inC #I don't know how to do it.
ThinkingCHR (10) + CHR (13)InC #When there is an equivalent line feed in, I thought of seeing it a few days agoKimUsed inStringreaderIt can be read by row, so this method is used by the producer, but so far it has not been found inC #Moderate andCHR (10) + CHR (13)
Equivalent line feed, so you still need to ask the senior person for advice...
AttachedSource code: Line number cleaner .rar