mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-12-10 02:38:06 +00:00
Allow toggling wrap-lines text operations (like mono block) (#6698)
This commit is contained in:
@@ -95,6 +95,20 @@ exports.repeat = function(str,count) {
|
||||
return result;
|
||||
};
|
||||
|
||||
/*
|
||||
Check if a string starts with another string
|
||||
*/
|
||||
exports.startsWith = function(str,search) {
|
||||
return str.substring(0, search.length) === search;
|
||||
};
|
||||
|
||||
/*
|
||||
Check if a string ends with another string
|
||||
*/
|
||||
exports.endsWith = function(str,search) {
|
||||
return str.substring(str.length - search.length) === search;
|
||||
};
|
||||
|
||||
/*
|
||||
Trim whitespace from the start and end of a string
|
||||
Thanks to Steven Levithan, http://blog.stevenlevithan.com/archives/faster-trim-javascript
|
||||
|
||||
Reference in New Issue
Block a user