File tree 4 files changed +37
-1
lines changed
4 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -88,9 +88,15 @@ <h3>random</h3>
88
88
89
89
< h3 > length</ h3 >
90
90
{{'Hello World' | length}}
91
+
92
+ < h3 > ltrim</ h3 >
93
+ {{' I was a string with leading whitespace' | ltrim}}
94
+
95
+ < h3 > rtrim</ h3 >
96
+ {{'I was a string with trailing whitespace ' | rtrim}}
91
97
92
98
< h3 > trim</ h3 >
93
- {{' I was a string with leading and trailing whitespace ' | trim}}
99
+ {{' I was a string with leading and trailing whitespace ' | trim}}
94
100
95
101
< h3 > list</ h3 >
96
102
{{colors | list}}
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Left trim a string, removing leading whitespace
3
+ * @param {string } input
4
+ * @return {string } left trimmed string
5
+ */
6
+ PolymerExpressions . prototype . ltrim = function ( input ) {
7
+ return input . replace ( / ^ \s + / , '' ) ;
8
+ }
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Right trim a string, removing trailing whitespace
3
+ * @param {string } input
4
+ * @return {string } left trimmed string
5
+ */
6
+ PolymerExpressions . prototype . rtrim = function ( input ) {
7
+ return input . replace ( / \s + $ / , '' ) ;
8
+ }
Original file line number Diff line number Diff line change 13
13
< script src ="filter-round.js "> </ script >
14
14
< script src ="filter-truncate.js "> </ script >
15
15
< script src ="filter-titlecase.js "> </ script >
16
+ < script src ="filter-ltrim.js "> </ script >
17
+ < script src ="filter-rtrim.js "> </ script >
16
18
< script src ="filter-trim.js "> </ script >
17
19
< script src ="filter-length.js "> </ script >
18
20
< script src ="filter-list.js "> </ script >
47
49
48
50
> Hello Peeps
49
51
52
+ ####LTrim
53
+
54
+ {{' I was a string with leading whitespace' | ltrim}}
55
+
56
+ > I was a string with leading whitespace
57
+
58
+ ####RTrim
59
+
60
+ {{'I was a string with trailing whitespace ' | rtrim}}
61
+
62
+ > I was a string with trailing whitespace
63
+
50
64
####Trim
51
65
52
66
{{' I was a string with leading and trailing whitespace ' | trim}}
You can’t perform that action at this time.
0 commit comments