The following is a line of huge .txt file and i am reading it line by line. I need the value of second column. In this line, I need to extract 'C9006'.
Mr ABC|C9006|The white field, ON|493-493-4939|493-493-4939|YR|Inactive
No开发者_开发知识库te : The delimiter char is pipe sign '|'. The length of second column is not consistent.
Help please.
String value = "A|B|C";
String secondColumn = value.split("|")[1];
You can use the Split method of String.
string result = input.Split('|')[1];
精彩评论