Find position of '@'

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
techimac
Posts: 318
Joined: Fri Feb 20, 2015 9:27 pm

Find position of '@'

Post by techimac » Tue Mar 20, 2018 10:18 pm

UserName.indexOf('@');

It does not work in EVAL statement
What is the correct format?
User avatar
thecoder2012
Posts: 405
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: Find position of '@'

Post by thecoder2012 » Tue Mar 27, 2018 5:48 pm

techimac wrote:UserName.indexOf('@');

It does not work in EVAL statement
What is the correct format?
try UserName.indexOf(String.fromCharCode(64));

Example:

Code: Select all

TAG POS=1 TYPE=INPUT:TEXT FORM=ID:UserName ATTR=NAME:UserName EXTRACT=TXT
SET newdata EVAL("var s = '{{!EXTRACT}}';s.indexOf(String.fromCharCode(64));")
PROMPT {{newdata}}
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me! :idea:
techimac
Posts: 318
Joined: Fri Feb 20, 2015 9:27 pm

Re: Find position of '@'

Post by techimac » Tue Mar 27, 2018 6:14 pm

Code: Select all

set !extract aa@a@aa
SET newdata EVAL("var s = '{{!EXTRACT}}';s.indexOf(String.fromCharCode(64));")
PROMPT {{newdata}}
Thanks
I forgot what i was doing but this worked
will keep it for future
Post Reply