Search
 
SCRIPT & CODE EXAMPLE
 

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);
Comment

how to get src value from img tag in c#

var shieldHomeContainer = nodeCollection.SelectSingleNode("//img").Attributes["src"].Value;
Comment

PREVIOUS NEXT
Code Example
Csharp :: fetch post .net 
Csharp :: multidimensional meaning 
Csharp :: principalcontext c# example 
Csharp :: linqkit predicatebuilder or and nested combined predicates 
Csharp :: checkbox on change c# xamarin forms 
Csharp :: c# break file into words 
Csharp :: allelrt box wpf 
Csharp :: Collision2d and Collider2d 
Csharp :: edit form item from class C# 
Csharp :: convert iqueryable to list c# 
Csharp :: C# if (if-then) Statement 
Csharp :: PasswordBox Helper 
Csharp :: open html file in browser using c++ 
Csharp :: c# check if file is zero bytes 
Csharp :: unity create file name datetime 
Csharp :: "??" in C# 
Csharp :: IAuthorizationFilter OnAuthorization AuthorizationContext MyAuthorizeAttribute HttpUnauthorizedResult HttpContext 
Csharp :: cefsharp not passing keydown to form 
Csharp :: c# creat pen 
Csharp :: c# .net core 3.0 trying Exception The transaction log for database is full due to ACTIVE_TRANSACTION 
Csharp :: unity play audio from particle system 
Csharp :: c# find the smallest string in an array of strings 
Csharp :: VideoPlayer.isPlaying 
Csharp :: Computing a Cartesian product or Combinations with LINQ 
Csharp :: c# unary operators 
Csharp :: ENUM error codes all 
Csharp :: what is the default value for an enum c# 
Csharp :: unity I run exe second monitor 
Csharp :: stack iterator c# 
Csharp :: asp.net web hooks 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =