Extensions for replace image source

Stable Version 1.0.0 (OutSystems 10)
Published on 11 Jan by 
Created on 11 Jan
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;

        }

Reviews (0)
Category
Components
Tags
Support Options
This component is not supported by OutSystems. You may use the discussion forums to leave suggestions or obtain best-effort support from the community, including from Vijay Malviya who created this component.
Dependencies
Extensions for replace image source has no dependencies.
Requirements
Platform:
10.0.0.402
Database:
All
Stack:
.NET
Component Consumers
No consumers yet.
Weekly Downloads