File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -217,11 +217,18 @@ local exampleDocMultiline(mid, ex) =
217
217
name: 'substr' ,
218
218
params: ['str' , 'from' , 'len' ],
219
219
availableSince: '0.10.0' ,
220
- description: |||
221
- Returns a string that is the part of <code>s</code> that starts at offset <code>from</code>
222
- and is <code>len</code> codepoints long. If the string <code>s</code> is shorter than
223
- <code>from+len</code>, the suffix starting at position <code>from</code> will be returned.
224
- ||| ,
220
+ description: html.paragraphs([
221
+ |||
222
+ Returns a string that is the part of <code>s</code> that starts at offset <code>from</code>
223
+ and is <code>len</code> codepoints long. If the string <code>s</code> is shorter than
224
+ <code>from+len</code>, the suffix starting at position <code>from</code> will be returned.
225
+ ||| ,
226
+ |||
227
+ The slice operator (e.g., <code>s[from:to]</code>) can also be used on strings, as an alternative
228
+ to this function. However, note that the slice operator takes a start and an end index, but
229
+ <code>std.substr</code> takes a start index and a length.
230
+ ||| ,
231
+ ]),
225
232
},
226
233
{
227
234
name: 'findSubstr' ,
Original file line number Diff line number Diff line change @@ -467,6 +467,11 @@ <h4 id="substr">
467
467
and is < code > len</ code > codepoints long. If the string < code > s</ code > is shorter than
468
468
< code > from+len</ code > , the suffix starting at position < code > from</ code > will be returned.
469
469
</ p >
470
+ < p >
471
+ The slice operator (e.g., < code > s[from:to]</ code > ) can also be used on strings, as an alternative
472
+ to this function. However, note that the slice operator takes a start and an end index, but
473
+ < code > std.substr</ code > takes a start index and a length.
474
+ </ p >
470
475
471
476
</ div >
472
477
< div style ="clear: both "> </ div >
You can’t perform that action at this time.
0 commit comments