Page 1 of 1

Clean string from "quote" and 'apostrophe'

Posted: 03 Oct 2016 03:51
by darioit
Hello,

how can I clean this string from
html += "src='https://text1.com/text2/text3-text4/text5.txt'";


to
https://text1.com/text2/text3-text4/text5.txt


Thank in advance

Re: Clean string from Bracket

Posted: 03 Oct 2016 04:00
by aGerman
It's enclosed into surrounding apostrophes. Thus, you could simply use them as delimiters in a FOR /F loop.

Code: Select all

set "string=html += "src='https://text1.com/text2/text3-text4/text5.txt'";"
for /f "tokens=2 delims='" %%i in ("%string%") do set "link=%%i"
echo %link%


Steffen

Re: Clean string from "quote" and 'apostrophe'

Posted: 03 Oct 2016 04:09
by darioit
Thank you very much, it's works fine !!

Best