query regarding fetch from right keyword

1,338 views
Skip to first unread message

rapid

unread,
Feb 22, 2015, 1:31:50 PM2/22/15
to robotframe...@googlegroups.com

Hi,

I want to use 'fetch from right' keyword from string library, but documentation says:

It Returns contents of the string after the last occurrence of marker.
If the marker is not found, whole string is returned.

how to use it? what is marker?


Laurent Bristiel

unread,
Feb 24, 2015, 5:09:21 AM2/24/15
to robotframe...@googlegroups.com
Hi,

the marker is the second argument of the keyword.
Here is an example:

*** settings ***
library  String

*** test cases ***
fetch from right examples
    ${result} =  fetch from right  this will look for marker and keep everything after it  marker
    log to console  ${\n}${result}
    ${result} =  fetch from right  if the marker is not foud you get the whole string  marker_not_there
    log to console  ${\n}${result} 

And here is the ouput:

$ pybot marker.robot
==============================================================================
Marker
==============================================================================
fetch from right examples                                             .
 and keep everything after it
if the marker is not foud you get the whole string
fetch from right examples       | PASS |
------------------------------------------------------------------------------

Hope this helps,
Laurent Bristiel
Reply all
Reply to author
Forward
0 new messages