You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libscript/src/string.mlc
+39-1Lines changed: 39 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,17 @@ Summary: Prepends <Source> to <Target>.
42
42
Source: An expression which evaluates to a string.
43
43
Target: An expression which evaluates to a string container.
44
44
45
+
Example:
46
+
variable tVar as string
47
+
put "" into tVar
48
+
put "abc" before tVar -- tVar contains "abc"
49
+
put "lpha" before char 2 of tVar
50
+
put "eti" before char -1 of tVar -- tVar contains "alphabetic"
51
+
52
+
Description:
53
+
Use to insert a string without replacement. Can be used either with a chunk expression to insert at a specified location, or without to prepend to the target string.
54
+
55
+
Tags: Strings
45
56
*/
46
57
47
58
syntax PutStringBefore is statement
@@ -56,6 +67,16 @@ Summary: Appends <Source> to <Target>.
56
67
Source: An expression which evaluates to a string.
57
68
Target: An expression which evaluates to a string container.
58
69
70
+
Example:
71
+
variable tVar as string
72
+
put "" into tVar
73
+
put "rent" after tVar -- tVar contains "rent"
74
+
put "placeme" after char 2 of tVar -- tVar contains "replacement"
75
+
76
+
Description:
77
+
Use to insert a string without replacement. Can be used either with a chunk expression to insert at a specified location, or without to append to the target string.
78
+
79
+
Tags: Strings
59
80
*/
60
81
61
82
syntax PutStringAfter is statement
@@ -80,6 +101,8 @@ Example:
80
101
81
102
Description:
82
103
Replaces each occurrence of the string <Pattern> in <Target> with <Replacement>.
104
+
105
+
Tags: Strings
83
106
*/
84
107
85
108
syntax ReplaceString is statement
@@ -104,6 +127,7 @@ Example:
104
127
Description:
105
128
The result consists of the chars of <Left> followed by those of <Right>.
106
129
130
+
Tags: Strings
107
131
*/
108
132
109
133
syntax ConcatenateStrings is left binary operator with precedence 2
@@ -125,6 +149,8 @@ Example:
125
149
126
150
Description:
127
151
The result consists of the chars of <Left> followed by a space, and then the chars of <Right>.
152
+
153
+
Tags: Strings
128
154
*/
129
155
130
156
syntax ConcatenateStringsWithSpace is left binary operator with precedence 2
@@ -142,6 +168,8 @@ output: <Source> with each of its chars uppercased.
142
168
143
169
Description:
144
170
Lowercase letters, including special characters with diacritical marks, are converted to the uppercase equivalents. All other characters, including uppercase letters, numbers, punctuation, and special characters with no upper or lower case, are left unchanged.
171
+
172
+
Tags: Strings
145
173
*/
146
174
147
175
@@ -157,7 +185,9 @@ Source: An expression which evaluates to a string.
157
185
output: <Source> with each of its chars lowercased.
158
186
159
187
Description:
160
-
Uppercase letters, including special characters with diacritical marks, are converted to the lowercase equivalents. All other characters, including lowercase letters, numbers, punctuation, and special characters with no upper or lower case, are left unchanged.
188
+
Uppercase letters, including special characters with diacritical marks, are converted to the lowercase equivalents. All other characters, including lowercase letters, numbers, punctuation, and special characters with no upper or lower case, are left unchanged.
189
+
190
+
Tags: Strings
161
191
*/
162
192
163
193
@@ -180,6 +210,7 @@ output: Returns true if <Left> is identical to <Right>.
180
210
Description:
181
211
The ```is``` operator is case sensitive.
182
212
213
+
Tags: Strings
183
214
*/
184
215
185
216
syntax IsEqualTo is neutral binary operator with precedence 5
@@ -198,6 +229,8 @@ output: Returns true if <Left> is not identical to <Right>.
198
229
199
230
Description:
200
231
The ```is not``` operator is case sensitive.
232
+
233
+
Tags: Strings
201
234
*/
202
235
203
236
syntax IsNotEqualTo is neutral binary operator with precedence 5
@@ -216,6 +249,8 @@ output: Returns true if <Left> is less than <Right>
216
249
217
250
Description:
218
251
<Left> is greater than <Right> if and only if <Left> and <Right> are not equal, and the unicode codepoint of the first char in <Left> that is not equal to the corresponding char in <Right> is of greater value.
252
+
253
+
Tags: Strings
219
254
*/
220
255
221
256
syntax LessThan is neutral binary operator with precedence 3
@@ -233,6 +268,8 @@ output: Returns true if <Left> is greater than <Right>.
233
268
234
269
Description:
235
270
<Left> is greater than <Right> if and only if <Left> and <Right> are not equal, and the unicode codepoint of the first char in <Left> that is not equal to the corresponding char in <Right> is of greater value.
271
+
272
+
Tags: Strings
236
273
*/
237
274
238
275
syntax GreaterThan is neutral binary operator with precedence 3
@@ -256,6 +293,7 @@ Example:
256
293
Description:
257
294
Use ```the empty string``` to initialise a string variable. The empty string is synonymous with the string literal ""
0 commit comments