private string[] captionF(string caption)
{
string[] captionarr = new string[0];
int needMAXlength = 60; //Обрезаем до.. символов
caption = caption + " "; //Добавляем в конце пробел чтоб "точно был"
int capI = 0;
do
{
Array.Resize(ref captionarr, captionarr.Length+1);
if (caption.Length < needMAXlength) { needMAXlength = caption.Length; }
captionarr[capI] = caption.Substring(0, needMAXlength);
if (caption[needMAXlength-1] != ' ')
{
int spacePosition = captionarr[capI].LastIndexOf(" ");
captionarr[capI] = caption.Substring(0, spacePosition);
}
caption = caption.Replace(captionarr[capI], "");
capI++;
}
while (caption.Length > 1); //При ">0" скрипт падал..
return captionarr;
}