extensions-for-replace-image-source

Extensions for replace image source

Stable version 1.0.0 (Compatible with OutSystems 11)
Also available for 10
Published on 11 January 2019 by 
0.0
 (0 ratings)
extensions-for-replace-image-source

Extensions for replace image source

Details
public static string FetchImgsFromSource(string htmlSource) { string OutSource = ""; string regexImgSrc = @"
Read more

public static string FetchImgsFromSource(string htmlSource)

        {

            string OutSource = "";

            string regexImgSrc = @"<img[^>]*?src\s*=\s*[""']?([^'"" >]+?)[ '""][^>]*?>";

            MatchCollection matchesImgSrc = Regex.Matches(htmlSource, regexImgSrc, RegexOptions.IgnoreCase | RegexOptions.Singleline);

            foreach (Match m in matchesImgSrc)

            {

                string href = m.Groups[1].Value;

                string imgvalue="";

                if (href.IndexOf("GUID=") != -1)

                {

                    int length_ = href.IndexOf("=");

                    imgvalue= href.Substring(length_+1);


                    htmlSource=htmlSource.Replace(href,"GetImg("+ imgvalue + ")");

                }





            }

            return OutSource= htmlSource;

        }

What’s new (1.0.0)
Reviews (0)