user5468794 user5468794 - 1 year ago 71
C# Question

Remove chars in beginning of string array

I am opening up a txt file and writing it to a string array. The issue is how is do I do the equivalent of a string,

with a string array? I know I have to loop through each [] in the array but then how do I get my desired result?

text file:

12345;9/19/2016 something.pdf

how I'm getting the file:

string[] lines = File.ReadAllLines(@"\\ecmvmdev21\text.txt");

Desired output:

9/19/2016 something.pdf

Answer Source

Loop through the array of strings as you said, then inside your for loop:

lines[i] = lines[i].Substring(6);

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download