Hi,
I would like to extract a portion of a string:
JS: "Hello world A \n Hello Universe B \n Hello Earth C\n"
AutoIt: "Hello world A {@CRLF} Hello Universe B {@CRLF} Hello Earth C {@CRLF}"
If i pass "Universe" to the function, I would like to get "B".
Javascript Code:
var str="Hello world A \n Hello Universe B \n Hello Earth C\n";
var param="Universe"
var pos = str.indexOf(param) +param.length ;
var n= str.substr(pos);
pos = n.indexOf("\n");
n = n.substr(0,pos);
<<n would return B>>
AutoIt code:
$str="Hello world A {@CRLF} Hello Universe B {@CRLF} Hello Earth C {@CRLF}" $param="Universe" $pos= StringInStr ($str, $param) + StringLen($param) ;todo $pos2 = StringInStr($str, @CRLF) ;todo
What would be a good equivalent here?
Thank You!