Faced a problem. I get a link and I need to extract a password-reset, how can I do this? For example, to get code I use queryParameters['code'], but how do I extract the word password-reset from the link, I need this text for navigation?
link
https://test.test.test.test/app/password-reset?code=6294
need to get
password-reset
>Solution :
Use substring, the code will extract the text between the last / and the first ?:
var link = "https://test.test.test.test/app/password-reset?code=6294";
var start = link.lastIndexOf('/') + 1;
var end = link.indexOf('?');
var extract = link.substring(start,end);
print(extract);