---
title: "Skip Image from Content using Regex"  
description: "Skip Image from Content using Regex"  
author: "Anonymous User"  
published: 2018-03-12  
updated: 2018-03-12  
canonical: https://www.mindstick.com/forum/34429/skip-image-from-content-using-regex  
category: "c#"  
tags: ["c#", "mvc"]  
reading_time: 1 minute  

---

# Skip Image from Content using Regex

I want to [skip](https://www.mindstick.com/forum/159872/what-is-the-skip-and-take-combination-in-linq) [image](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character) from [content](https://www.mindstick.com/articles/13019/get-the-best-content-marketing-pricing-packages-for-your-brand) ..this is my [sample](https://www.mindstick.com/news/2174/mars-mission-by-nasa-prepares-for-tests) [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) please help

```
@{
    string regexImgSrc = @"<img[^>]*?src\s*=\s*[""']?([^'"" >]+?)[ '""][^>]*?>";
}
 @if (post.Content.Length > 70)
        {               var str = post.Content.Substring(0, 70);
           }
```

## Replies

### Reply by Anonymous User

try this code this will helps you

```
@{
   string regexImgSrc = @"<img[^>]*?src\s*=\s*[""']?([^'"" >]+?)[ '""][^>]*?>";
}
 @if (post.Content.Length > 70)
                {
                  var str = post.Content.Substring(0, 70);
 @Html.Raw(System.Text.RegularExpressions.Regex.Replace(str.ToString(), regexImgSrc, ""))
                                                                    }
```


---

Original Source: https://www.mindstick.com/forum/34429/skip-image-from-content-using-regex

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
