mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2025-12-06 02:30:46 -08:00
parent
6099ec576c
commit
2e2ed7902c
7 changed files with 39 additions and 5 deletions
|
|
@ -92,6 +92,13 @@ exports.trim = function(str) {
|
|||
}
|
||||
};
|
||||
|
||||
/*
|
||||
Convert a string to sentence case (ie capitalise each initial letter)
|
||||
*/
|
||||
exports.toSentenceCase = function(str) {
|
||||
return (str || "").toLowerCase().replace(/(^|\s)\S/g, function(c) {return c.toUpperCase();});
|
||||
}
|
||||
|
||||
/*
|
||||
Find the line break preceding a given position in a string
|
||||
Returns position immediately after that line break, or the start of the string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue