How to do automatic linebreaks?

nova

Client
Регистрация
09.10.2011
Сообщения
88
Благодарностей
7
Баллы
8
I am trying to do automatic linebreaks.
How to do automatic linebreaks?

Say for example i set a variable to:

"Dark pools may sound like the favorite haunts of Star Wars villains, but they are simply venues where buyers and sellers can submit bids without disclosing them to the public markets. Citadel operates a dark pool called Apogee out of its New York office.Citadel's programmers are constantly making adjustments as computers learn customer behavior to make the process more efficient. All the decisions are made by the computers, Jamil Nazarali, Citadel's head of electronic execution, told CNNMoney during an exclusive behind-the-scenes tour. The people here arenot making any decisions with respect to whether an order should be filled or at what price it should be filled. That's all done in an automated way."

Now what i want to do is make it use {-String.Enter-} after x-y characters. But i dont want it to chop the words. Instead i want it to use {-String.Enter-} where the space is.

So like say after 28-35 characters it should do a linebreak, but not chop off the words, it would insert {-String.Enter-} to the closest space.

Anyone know how this can be done? I thought about using the Word processing and use the "Replace" function. and replace a space with {-String.Enter-} and use a match number, but i am having trouble with it. I am thinking maybe there is a better way to do this.

Any help would be greatly appreciated.

BTW: is there a way to see how many characters are in a variable?

Thanks
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Count characters in variable you can with c#.

Код:
string strsample = "Hello World";
return strsample.Length.ToString();
About all your other requests i would use C# as well but not ready snippets for that :-)
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)