I have a RTB that is loaded with a file that looks like this:
J6 INT-00113G 227.905 174.994 180 SOIC8
J3 INT-00113G 227.905 203.244 180 SOIC8
U13 EXCLUDES 242.210 181.294 180 QFP128
U3 IC-00276G 236.135 198.644 90 BGA48
U12 IC-00270G 250.610 201.594 0 SOP8
J1 INT-00112G 269.665 179.894 180 SOIC16
J2 INT-00112G 269.665 198.144 180 SOIC16
I want to remove the last column using the string.Split() method.
So far I have:
// Splits the lines in the rich text boxes
string[] lines = richTextBox2.Text.Split('\n');
foreach (var newLine in lines)
{
newLine.Split(' ');
line = line[0] + line[1] + line[2] + line[3] + line[4]; #This is the code that does not work.
}
However this does not work... does anyone know the problem and how to do this properly so the file looks like this?:
J6 INT-00113G 227.905 174.994 180
J3 INT-00113G 227.905 203.244 180
U13 EXCLUDES 242.210 181.294 180
U3 IC-00276G 236.135 198.644 90
U12 IC-00270G 250.610 201.594 0
J1 INT-00112G 269.665 179.894 180
J2 INT-00112G 269.665 198.144 180
EDIT: I also think that I need to string.Split(' ') each line that is already split?