Is it possible to trim the stored text in variable using kantu?

Hi

I have stored value of web element in variable using the ‘Store’ method. Is there any way in Kantu to trim the first and last character of that variable and store it again ?

You can use Javascript to trim strings.

storeEval | a = storedVars['q']; a = a.replace(/( |\n|\r)/gm, ""); a | trimmedQ

You find this line in the DemoPDFTest_with_OCR macro.

Related: See here for extracting substrings:

This answer is outdated. Use ExecuteScript instead of StoreEval: How to get the numbers in the text? - #3 by max

1 Like