cfe45af5fc49258458813874ed65968e81b8c179
[platform/framework/web/crosswalk-tizen.git] /
1 define(['../lang/toString', './lowerCase', './upperCase'], function(toString, lowerCase, upperCase){
2     /**
3      * UPPERCASE first char of each sentence and lowercase other chars.
4      */
5     function sentenceCase(str){
6         str = toString(str);
7
8         // Replace first char of each sentence (new line or after '.\s+') to
9         // UPPERCASE
10         return lowerCase(str).replace(/(^\w)|\.\s+(\w)/gm, upperCase);
11     }
12     return sentenceCase;
13 });