I have a list and a column; the column might have many values, and each value’s length may vary.
If the length exceeds 100, I want to append /n at the end of it.
Need your help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I give it a try, though a lot of questions are open (what type of list, what a column, …).
In short: you can use
String.Insertto insert text at a specified postition.Assuming you have a
List<Foo>, the classFoohas astringpropertyValue(your column). If it’sLengthexceeds 100 the line should be wrapped:http://msdn.microsoft.com/en-us/library/system.string.insert.aspx
Here’s running code with sample data.
http://ideone.com/sUKLk