In flex,
I have a below string:
Chocolate has become one of the most popular food types and flavors in the world, and a vast number of foodstuffs involving chocolate have been created. Chocolate chip cookies have become very common, and very popular, in most parts of Europe and North America.
Gifts of chocolate molded into different shapes have become traditional on certain holidays. Chocolate is also used in cold and hot beverages, to produce chocolate milk and hot chocolate.
Cocoa mass was used originally in Mesoamerica both as a beverage and as an ingredient in foods.
Above string contains three paragraphs. How could I count paragraph from above string ?
I have tried like this:
for(var i:int = 0; i < bodyPhrases.length; i++)
{
var para:int = bodyPhrases.indexOf("\r\r");
var p:String = bodyPhrases.substring(1,para);
paraCount++;
bodyPhrases = bodyPhrases.replace(p,"");
}
It takes more loop. how to find it in a easy way.