forked from fjzffsky/AutoLine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathString.xml
699 lines (601 loc) · 22.2 KB
/
String.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
<?xml version="1.0" encoding="UTF-8"?>
<keywordspec name="String" type="library" format="ROBOT" generated="20180425 10:46:42">
<version>3.0.3</version>
<scope>global</scope>
<namedargs>yes</namedargs>
<doc>A test library for string manipulation and verification.
``String`` is Robot Framework's standard library for manipulating
strings (e.g. `Replace String Using Regexp`, `Split To Lines`) and
verifying their contents (e.g. `Should Be String`).
Following keywords from ``BuiltIn`` library can also be used with strings:
- `Catenate`
- `Get Length`
- `Length Should Be`
- `Should (Not) Be Empty`
- `Should (Not) Be Equal (As Strings/Integers/Numbers)`
- `Should (Not) Match (Regexp)`
- `Should (Not) Contain`
- `Should (Not) Start With`
- `Should (Not) End With`
- `Convert To String`
- `Convert To Bytes`</doc>
<kw name="Convert To Lowercase">
<arguments>
<arg>string</arg>
</arguments>
<doc>Converts string to lowercase.
Examples:
| ${str1} = | Convert To Lowercase | ABC |
| ${str2} = | Convert To Lowercase | 1A2c3D |
| Should Be Equal | ${str1} | abc |
| Should Be Equal | ${str2} | 1a2c3d |
New in Robot Framework 2.8.6.</doc>
<tags>
</tags>
</kw>
<kw name="Convert To Uppercase">
<arguments>
<arg>string</arg>
</arguments>
<doc>Converts string to uppercase.
Examples:
| ${str1} = | Convert To Uppercase | abc |
| ${str2} = | Convert To Uppercase | 1a2C3d |
| Should Be Equal | ${str1} | ABC |
| Should Be Equal | ${str2} | 1A2C3D |
New in Robot Framework 2.8.6.</doc>
<tags>
</tags>
</kw>
<kw name="Decode Bytes To String">
<arguments>
<arg>bytes</arg>
<arg>encoding</arg>
<arg>errors=strict</arg>
</arguments>
<doc>Decodes the given ``bytes`` to a Unicode string using the given ``encoding``.
``errors`` argument controls what to do if decoding some bytes fails.
All values accepted by ``decode`` method in Python are valid, but in
practice the following values are most useful:
- ``strict``: fail if characters cannot be decoded (default)
- ``ignore``: ignore characters that cannot be decoded
- ``replace``: replace characters that cannot be decoded with
a replacement character
Examples:
| ${string} = | Decode Bytes To String | ${bytes} | UTF-8 |
| ${string} = | Decode Bytes To String | ${bytes} | ASCII | errors=ignore |
Use `Encode String To Bytes` if you need to convert Unicode strings to
byte strings, and `Convert To String` in ``BuiltIn`` if you need to
convert arbitrary objects to Unicode strings.</doc>
<tags>
</tags>
</kw>
<kw name="Encode String To Bytes">
<arguments>
<arg>string</arg>
<arg>encoding</arg>
<arg>errors=strict</arg>
</arguments>
<doc>Encodes the given Unicode ``string`` to bytes using the given ``encoding``.
``errors`` argument controls what to do if encoding some characters fails.
All values accepted by ``encode`` method in Python are valid, but in
practice the following values are most useful:
- ``strict``: fail if characters cannot be encoded (default)
- ``ignore``: ignore characters that cannot be encoded
- ``replace``: replace characters that cannot be encoded with
a replacement character
Examples:
| ${bytes} = | Encode String To Bytes | ${string} | UTF-8 |
| ${bytes} = | Encode String To Bytes | ${string} | ASCII | errors=ignore |
Use `Convert To Bytes` in ``BuiltIn`` if you want to create bytes based
on character or integer sequences. Use `Decode Bytes To String` if you
need to convert byte strings to Unicode strings and `Convert To String`
in ``BuiltIn`` if you need to convert arbitrary objects to Unicode.</doc>
<tags>
</tags>
</kw>
<kw name="Fetch From Left">
<arguments>
<arg>string</arg>
<arg>marker</arg>
</arguments>
<doc>Returns contents of the ``string`` before the first occurrence of ``marker``.
If the ``marker`` is not found, whole string is returned.
See also `Fetch From Right`, `Split String` and `Split String
From Right`.</doc>
<tags>
</tags>
</kw>
<kw name="Fetch From Right">
<arguments>
<arg>string</arg>
<arg>marker</arg>
</arguments>
<doc>Returns contents of the ``string`` after the last occurrence of ``marker``.
If the ``marker`` is not found, whole string is returned.
See also `Fetch From Left`, `Split String` and `Split String
From Right`.</doc>
<tags>
</tags>
</kw>
<kw name="Generate Random String">
<arguments>
<arg>length=8</arg>
<arg>chars=[LETTERS][NUMBERS]</arg>
</arguments>
<doc>Generates a string with a desired ``length`` from the given ``chars``.
The population sequence ``chars`` contains the characters to use
when generating the random string. It can contain any
characters, and it is possible to use special markers
explained in the table below:
| = Marker = | = Explanation = |
| ``[LOWER]`` | Lowercase ASCII characters from ``a`` to ``z``. |
| ``[UPPER]`` | Uppercase ASCII characters from ``A`` to ``Z``. |
| ``[LETTERS]`` | Lowercase and uppercase ASCII characters. |
| ``[NUMBERS]`` | Numbers from 0 to 9. |
Examples:
| ${ret} = | Generate Random String |
| ${low} = | Generate Random String | 12 | [LOWER] |
| ${bin} = | Generate Random String | 8 | 01 |
| ${hex} = | Generate Random String | 4 | [NUMBERS]abcdef |</doc>
<tags>
</tags>
</kw>
<kw name="Get Line">
<arguments>
<arg>string</arg>
<arg>line_number</arg>
</arguments>
<doc>Returns the specified line from the given ``string``.
Line numbering starts from 0 and it is possible to use
negative indices to refer to lines from the end. The line is
returned without the newline character.
Examples:
| ${first} = | Get Line | ${string} | 0 |
| ${2nd last} = | Get Line | ${string} | -2 |
Use `Split To Lines` if all lines are needed.</doc>
<tags>
</tags>
</kw>
<kw name="Get Line Count">
<arguments>
<arg>string</arg>
</arguments>
<doc>Returns and logs the number of lines in the given string.</doc>
<tags>
</tags>
</kw>
<kw name="Get Lines Containing String">
<arguments>
<arg>string</arg>
<arg>pattern</arg>
<arg>case_insensitive=False</arg>
</arguments>
<doc>Returns lines of the given ``string`` that contain the ``pattern``.
The ``pattern`` is always considered to be a normal string, not a glob
or regexp pattern. A line matches if the ``pattern`` is found anywhere
on it.
The match is case-sensitive by default, but giving ``case_insensitive``
a true value makes it case-insensitive. The value is considered true
if it is a non-empty string that is not equal to ``false``, ``none`` or
``no``. If the value is not a string, its truth value is got directly
in Python. Considering ``none`` false is new in RF 3.0.3.
Lines are returned as one string catenated back together with
newlines. Possible trailing newline is never returned. The
number of matching lines is automatically logged.
Examples:
| ${lines} = | Get Lines Containing String | ${result} | An example |
| ${ret} = | Get Lines Containing String | ${ret} | FAIL | case-insensitive |
See `Get Lines Matching Pattern` and `Get Lines Matching Regexp`
if you need more complex pattern matching.</doc>
<tags>
</tags>
</kw>
<kw name="Get Lines Matching Pattern">
<arguments>
<arg>string</arg>
<arg>pattern</arg>
<arg>case_insensitive=False</arg>
</arguments>
<doc>Returns lines of the given ``string`` that match the ``pattern``.
The ``pattern`` is a _glob pattern_ where:
| ``*`` | matches everything |
| ``?`` | matches any single character |
| ``[chars]`` | matches any character inside square brackets (e.g. ``[abc]`` matches either ``a``, ``b`` or ``c``) |
| ``[!chars]`` | matches any character not inside square brackets |
A line matches only if it matches the ``pattern`` fully.
The match is case-sensitive by default, but giving ``case_insensitive``
a true value makes it case-insensitive. The value is considered true
if it is a non-empty string that is not equal to ``false``, ``none`` or
``no``. If the value is not a string, its truth value is got directly
in Python. Considering ``none`` false is new in RF 3.0.3.
Lines are returned as one string catenated back together with
newlines. Possible trailing newline is never returned. The
number of matching lines is automatically logged.
Examples:
| ${lines} = | Get Lines Matching Pattern | ${result} | Wild???? example |
| ${ret} = | Get Lines Matching Pattern | ${ret} | FAIL: * | case_insensitive=true |
See `Get Lines Matching Regexp` if you need more complex
patterns and `Get Lines Containing String` if searching
literal strings is enough.</doc>
<tags>
</tags>
</kw>
<kw name="Get Lines Matching Regexp">
<arguments>
<arg>string</arg>
<arg>pattern</arg>
<arg>partial_match=False</arg>
</arguments>
<doc>Returns lines of the given ``string`` that match the regexp ``pattern``.
See `BuiltIn.Should Match Regexp` for more information about
Python regular expression syntax in general and how to use it
in Robot Framework test data in particular.
By default lines match only if they match the pattern fully, but
partial matching can be enabled by giving the ``partial_match``
argument a true value. The value is considered true
if it is a non-empty string that is not equal to ``false``, ``none`` or
``no``. If the value is not a string, its truth value is got directly
in Python. Considering ``none`` false is new in RF 3.0.3.
If the pattern is empty, it matches only empty lines by default.
When partial matching is enabled, empty pattern matches all lines.
Notice that to make the match case-insensitive, you need to prefix
the pattern with case-insensitive flag ``(?i)``.
Lines are returned as one string concatenated back together with
newlines. Possible trailing newline is never returned. The
number of matching lines is automatically logged.
Examples:
| ${lines} = | Get Lines Matching Regexp | ${result} | Reg\\w{3} example |
| ${lines} = | Get Lines Matching Regexp | ${result} | Reg\\w{3} example | partial_match=true |
| ${ret} = | Get Lines Matching Regexp | ${ret} | (?i)FAIL: .* |
See `Get Lines Matching Pattern` and `Get Lines Containing
String` if you do not need full regular expression powers (and
complexity).
``partial_match`` argument is new in Robot Framework 2.9. In earlier
versions exact match was always required.</doc>
<tags>
</tags>
</kw>
<kw name="Get Regexp Matches">
<arguments>
<arg>string</arg>
<arg>pattern</arg>
<arg>*groups</arg>
</arguments>
<doc>Returns a list of all non-overlapping matches in the given string.
``string`` is the string to find matches from and ``pattern`` is the
regular expression. See `BuiltIn.Should Match Regexp` for more
information about Python regular expression syntax in general and how
to use it in Robot Framework test data in particular.
If no groups are used, the returned list contains full matches. If one
group is used, the list contains only contents of that group. If
multiple groups are used, the list contains tuples that contain
individual group contents. All groups can be given as indexes (starting
from 1) and named groups also as names.
Examples:
| ${no match} = | Get Regexp Matches | the string | xxx |
| ${matches} = | Get Regexp Matches | the string | t.. |
| ${one group} = | Get Regexp Matches | the string | t(..) | 1 |
| ${named group} = | Get Regexp Matches | the string | t(?P<name>..) | name |
| ${two groups} = | Get Regexp Matches | the string | t(.)(.) | 1 | 2 |
=>
| ${no match} = []
| ${matches} = ['the', 'tri']
| ${one group} = ['he', 'ri']
| ${named group} = ['he', 'ri']
| ${two groups} = [('h', 'e'), ('r', 'i')]
New in Robot Framework 2.9.</doc>
<tags>
</tags>
</kw>
<kw name="Get Substring">
<arguments>
<arg>string</arg>
<arg>start</arg>
<arg>end=None</arg>
</arguments>
<doc>Returns a substring from ``start`` index to ``end`` index.
The ``start`` index is inclusive and ``end`` is exclusive.
Indexing starts from 0, and it is possible to use
negative indices to refer to characters from the end.
Examples:
| ${ignore first} = | Get Substring | ${string} | 1 | |
| ${ignore last} = | Get Substring | ${string} | | -1 |
| ${5th to 10th} = | Get Substring | ${string} | 4 | 10 |
| ${first two} = | Get Substring | ${string} | | 1 |
| ${last two} = | Get Substring | ${string} | -2 | |</doc>
<tags>
</tags>
</kw>
<kw name="Remove String">
<arguments>
<arg>string</arg>
<arg>*removables</arg>
</arguments>
<doc>Removes all ``removables`` from the given ``string``.
``removables`` are used as literal strings. Each removable will be
matched to a temporary string from which preceding removables have
been already removed. See second example below.
Use `Remove String Using Regexp` if more powerful pattern matching is
needed. If only a certain number of matches should be removed,
`Replace String` or `Replace String Using Regexp` can be used.
A modified version of the string is returned and the original
string is not altered.
Examples:
| ${str} = | Remove String | Robot Framework | work |
| Should Be Equal | ${str} | Robot Frame |
| ${str} = | Remove String | Robot Framework | o | bt |
| Should Be Equal | ${str} | R Framewrk |
New in Robot Framework 2.8.2.</doc>
<tags>
</tags>
</kw>
<kw name="Remove String Using Regexp">
<arguments>
<arg>string</arg>
<arg>*patterns</arg>
</arguments>
<doc>Removes ``patterns`` from the given ``string``.
This keyword is otherwise identical to `Remove String`, but
the ``patterns`` to search for are considered to be a regular
expression. See `Replace String Using Regexp` for more information
about the regular expression syntax. That keyword can also be
used if there is a need to remove only a certain number of
occurrences.
New in Robot Framework 2.8.2.</doc>
<tags>
</tags>
</kw>
<kw name="Replace String">
<arguments>
<arg>string</arg>
<arg>search_for</arg>
<arg>replace_with</arg>
<arg>count=-1</arg>
</arguments>
<doc>Replaces ``search_for`` in the given ``string`` with ``replace_with``.
``search_for`` is used as a literal string. See `Replace String
Using Regexp` if more powerful pattern matching is needed.
If you need to just remove a string see `Remove String`.
If the optional argument ``count`` is given, only that many
occurrences from left are replaced. Negative ``count`` means
that all occurrences are replaced (default behaviour) and zero
means that nothing is done.
A modified version of the string is returned and the original
string is not altered.
Examples:
| ${str} = | Replace String | Hello, world! | world | tellus |
| Should Be Equal | ${str} | Hello, tellus! | | |
| ${str} = | Replace String | Hello, world! | l | ${EMPTY} | count=1 |
| Should Be Equal | ${str} | Helo, world! | | |</doc>
<tags>
</tags>
</kw>
<kw name="Replace String Using Regexp">
<arguments>
<arg>string</arg>
<arg>pattern</arg>
<arg>replace_with</arg>
<arg>count=-1</arg>
</arguments>
<doc>Replaces ``pattern`` in the given ``string`` with ``replace_with``.
This keyword is otherwise identical to `Replace String`, but
the ``pattern`` to search for is considered to be a regular
expression. See `BuiltIn.Should Match Regexp` for more
information about Python regular expression syntax in general
and how to use it in Robot Framework test data in particular.
If you need to just remove a string see `Remove String Using Regexp`.
Examples:
| ${str} = | Replace String Using Regexp | ${str} | 20\\d\\d-\\d\\d-\\d\\d | <DATE> |
| ${str} = | Replace String Using Regexp | ${str} | (Hello|Hi) | ${EMPTY} | count=1 |</doc>
<tags>
</tags>
</kw>
<kw name="Should Be Byte String">
<arguments>
<arg>item</arg>
<arg>msg=None</arg>
</arguments>
<doc>Fails if the given ``item`` is not a byte string.
Use `Should Be Unicode String` if you want to verify the ``item`` is a
Unicode string, or `Should Be String` if both Unicode and byte strings
are fine. See `Should Be String` for more details about Unicode strings
and byte strings.
The default error message can be overridden with the optional
``msg`` argument.</doc>
<tags>
</tags>
</kw>
<kw name="Should Be Lowercase">
<arguments>
<arg>string</arg>
<arg>msg=None</arg>
</arguments>
<doc>Fails if the given ``string`` is not in lowercase.
For example, ``'string'`` and ``'with specials!'`` would pass, and
``'String'``, ``''`` and ``' '`` would fail.
The default error message can be overridden with the optional
``msg`` argument.
See also `Should Be Uppercase` and `Should Be Titlecase`.</doc>
<tags>
</tags>
</kw>
<kw name="Should Be String">
<arguments>
<arg>item</arg>
<arg>msg=None</arg>
</arguments>
<doc>Fails if the given ``item`` is not a string.
With Python 2, except with IronPython, this keyword passes regardless
is the ``item`` a Unicode string or a byte string. Use `Should Be
Unicode String` or `Should Be Byte String` if you want to restrict
the string type. Notice that with Python 2, except with IronPython,
``'string'`` creates a byte string and ``u'unicode'`` must be used to
create a Unicode string.
With Python 3 and IronPython, this keyword passes if the string is
a Unicode string but fails if it is bytes. Notice that with both
Python 3 and IronPython, ``'string'`` creates a Unicode string, and
``b'bytes'`` must be used to create a byte string.
The default error message can be overridden with the optional
``msg`` argument.</doc>
<tags>
</tags>
</kw>
<kw name="Should Be Titlecase">
<arguments>
<arg>string</arg>
<arg>msg=None</arg>
</arguments>
<doc>Fails if given ``string`` is not title.
``string`` is a titlecased string if there is at least one
character in it, uppercase characters only follow uncased
characters and lowercase characters only cased ones.
For example, ``'This Is Title'`` would pass, and ``'Word In UPPER'``,
``'Word In lower'``, ``''`` and ``' '`` would fail.
The default error message can be overridden with the optional
``msg`` argument.
See also `Should Be Uppercase` and `Should Be Lowercase`.</doc>
<tags>
</tags>
</kw>
<kw name="Should Be Unicode String">
<arguments>
<arg>item</arg>
<arg>msg=None</arg>
</arguments>
<doc>Fails if the given ``item`` is not a Unicode string.
Use `Should Be Byte String` if you want to verify the ``item`` is a
byte string, or `Should Be String` if both Unicode and byte strings
are fine. See `Should Be String` for more details about Unicode
strings and byte strings.
The default error message can be overridden with the optional
``msg`` argument.</doc>
<tags>
</tags>
</kw>
<kw name="Should Be Uppercase">
<arguments>
<arg>string</arg>
<arg>msg=None</arg>
</arguments>
<doc>Fails if the given ``string`` is not in uppercase.
For example, ``'STRING'`` and ``'WITH SPECIALS!'`` would pass, and
``'String'``, ``''`` and ``' '`` would fail.
The default error message can be overridden with the optional
``msg`` argument.
See also `Should Be Titlecase` and `Should Be Lowercase`.</doc>
<tags>
</tags>
</kw>
<kw name="Should Not Be String">
<arguments>
<arg>item</arg>
<arg>msg=None</arg>
</arguments>
<doc>Fails if the given ``item`` is a string.
See `Should Be String` for more details about Unicode strings and byte
strings.
The default error message can be overridden with the optional
``msg`` argument.</doc>
<tags>
</tags>
</kw>
<kw name="Split String">
<arguments>
<arg>string</arg>
<arg>separator=None</arg>
<arg>max_split=-1</arg>
</arguments>
<doc>Splits the ``string`` using ``separator`` as a delimiter string.
If a ``separator`` is not given, any whitespace string is a
separator. In that case also possible consecutive whitespace
as well as leading and trailing whitespace is ignored.
Split words are returned as a list. If the optional
``max_split`` is given, at most ``max_split`` splits are done, and
the returned list will have maximum ``max_split + 1`` elements.
Examples:
| @{words} = | Split String | ${string} |
| @{words} = | Split String | ${string} | ,${SPACE} |
| ${pre} | ${post} = | Split String | ${string} | :: | 1 |
See `Split String From Right` if you want to start splitting
from right, and `Fetch From Left` and `Fetch From Right` if
you only want to get first/last part of the string.</doc>
<tags>
</tags>
</kw>
<kw name="Split String From Right">
<arguments>
<arg>string</arg>
<arg>separator=None</arg>
<arg>max_split=-1</arg>
</arguments>
<doc>Splits the ``string`` using ``separator`` starting from right.
Same as `Split String`, but splitting is started from right. This has
an effect only when ``max_split`` is given.
Examples:
| ${first} | ${rest} = | Split String | ${string} | - | 1 |
| ${rest} | ${last} = | Split String From Right | ${string} | - | 1 |</doc>
<tags>
</tags>
</kw>
<kw name="Split String To Characters">
<arguments>
<arg>string</arg>
</arguments>
<doc>Splits the given ``string`` to characters.
Example:
| @{characters} = | Split String To Characters | ${string} |</doc>
<tags>
</tags>
</kw>
<kw name="Split To Lines">
<arguments>
<arg>string</arg>
<arg>start=0</arg>
<arg>end=None</arg>
</arguments>
<doc>Splits the given string to lines.
It is possible to get only a selection of lines from ``start``
to ``end`` so that ``start`` index is inclusive and ``end`` is
exclusive. Line numbering starts from 0, and it is possible to
use negative indices to refer to lines from the end.
Lines are returned without the newlines. The number of
returned lines is automatically logged.
Examples:
| @{lines} = | Split To Lines | ${manylines} | | |
| @{ignore first} = | Split To Lines | ${manylines} | 1 | |
| @{ignore last} = | Split To Lines | ${manylines} | | -1 |
| @{5th to 10th} = | Split To Lines | ${manylines} | 4 | 10 |
| @{first two} = | Split To Lines | ${manylines} | | 1 |
| @{last two} = | Split To Lines | ${manylines} | -2 | |
Use `Get Line` if you only need to get a single line.</doc>
<tags>
</tags>
</kw>
<kw name="Strip String">
<arguments>
<arg>string</arg>
<arg>mode=both</arg>
<arg>characters=None</arg>
</arguments>
<doc>Remove leading and/or trailing whitespaces from the given string.
``mode`` is either ``left`` to remove leading characters, ``right`` to
remove trailing characters, ``both`` (default) to remove the
characters from both sides of the string or ``none`` to return the
unmodified string.
If the optional ``characters`` is given, it must be a string and the
characters in the string will be stripped in the string. Please note,
that this is not a substring to be removed but a list of characters,
see the example below.
Examples:
| ${stripped}= | Strip String | ${SPACE}Hello${SPACE} | |
| Should Be Equal | ${stripped} | Hello | |
| ${stripped}= | Strip String | ${SPACE}Hello${SPACE} | mode=left |
| Should Be Equal | ${stripped} | Hello${SPACE} | |
| ${stripped}= | Strip String | aabaHelloeee | characters=abe |
| Should Be Equal | ${stripped} | Hello | |
New in Robot Framework 3.0.</doc>
<tags>
</tags>
</kw>
</keywordspec>