Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# how to get src from html img

string str = "<div> <img src="https://i.testimg.com/images/g/test/s-l400.jpg" style="width: 100%;"> <div>Test</div> </div>";

// Get the index of where the value of src starts.
int start = str.IndexOf("<img src="") + 10;

// Get the substring that starts at start, and goes up to first ".
string src = str.Substring(start, str.IndexOf(""", start) - start);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #src #html #img
ADD COMMENT
Topic
Name
9+9 =