1
0
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:
Max Schillinger
2022-05-17 22:16:54 +02:00
committed by GitHub
parent 855b6719d6
commit 5ea315fb98
2 changed files with 41 additions and 10 deletions

View File

@@ -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