How to cut some character from the string to make "caption" for news
Hj All. I have a question that's i want to cut or separate the string to make a caption for my news or something.I mean i have a paragrap and i want to take some character from paragrap to make a caption for my article or news.Notherwise that's a brief of paragrap.Someone help me about that!Thanks .

Javeed M ShaikhRank #839 · 2.7K reputationPosted Nov 8, 2011, 4:27 AM EST
if you just want to cut some characters from a string, try this..
string MyString = "Hello Cut Me!";
Console.WriteLine(MyString.Remove(5,3));
it should remove the "Cut" word.
viet vo quoc114 reputationPosted Nov 8, 2011, 4:58 AM EST
Javeed M ShaikhRank #839 · 2.7K reputationPosted Nov 8, 2011, 5:55 AM EST
^(\w+\b.*?){10}
Dipal ChoksiRank #199 · 12K reputationPosted Nov 8, 2011, 5:56 AM EST
http://nickstips.wordpress.com/2010/02/12/c-truncate-a-string-at-the-end-of-a-word/
you can also use string.split and then use logic to count the characters.
Sam HobbsRank #107 · 20.5K reputationPosted Nov 8, 2011, 8:37 AM EST
If it were me, I would use a console program to write and test the code, and then copy the code into my main program. You will need a little time to get it working correctly and you will learn from the experience. Someone might write all the code for you, but I think it will be more educational for you if you learn from doing it yourself.
Manoj SevdaRank #1,670 · 916 reputationPosted Nov 11, 2011, 8:25 PM EST
string para = "balabalabalabala"
if (lblPara.Text.Length > 50)
lblPara.Text = para.Substring(0, 50) + ".. ";
else
lblPara.Text = para.Text;