gpt4 book ai didi

robotframework - 如何从机器人框架中的一行拆分字符串

转载 作者:行者123 更新时间:2023-12-04 06:42:58 31 4
gpt4 key购买 nike

如何从变量中获取其余值

${random employee}= Convert To String   ${random emp}   
${replace}= Remove String Using Regexp ${random employee} ['\\[\\]\\,]

${splitline}= Fetch From Left ${replace} ${SPACE}

输出:
${replace} Alagu kartest1234+3alagu@gmail.cokartest1234+3ramu@gmail.com Developer Team B3 Team lead
${splitline} = Alagu

如何从变量 ${replace} 中获取其余值

最佳答案

关键字 Split String来自 String standard library做这个。

Split String    string, separator=None, max_split=-1

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.



示例:
@{words} =  Split String    ${string}           
@{words} = Split String ${string} ,${SPACE}

@{words} 获取单个值使用通用数组语法: @{NAME}[i] . i是所选值的索引。索引从零开始。

关于robotframework - 如何从机器人框架中的一行拆分字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32820905/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com