生活随笔
收集整理的這篇文章主要介紹了
.Net在线编辑工具.NET Fiddle
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
介紹
推薦工具:.NET Fiddle
推薦理由:在線調(diào)試,編譯,運(yùn)行.net代碼,同時支持C#,VB.NET,F#
推薦說明::對于.NET開發(fā)者來說是福音,因?yàn)槲覀兛梢圆挥迷贀?dān)心環(huán)境與龐大的IDE的問題,不管在任何時間,任何環(huán)境,如果有了什么點(diǎn)子,打開dotnetfiddle.net,輸入你的代碼;總的來說,它能夠讓你在瀏覽器窗體重復(fù)折騰代碼片段而無需運(yùn)行Visual Studio。當(dāng)你僅僅是調(diào)試少量代碼時這實(shí)在是太方便了。.NET Fiddle的一個最大賣點(diǎn)就是它是免費(fèi)的。
網(wǎng)站截圖:
小試牛刀
看看我的代碼
using System;public class Program
{public static void Main(){string img = "i<img style='aaa' />j<Img style='bbb' />k<img style='ccc' ></img>";Console.WriteLine(ReplacehtmlBody(img));Console.WriteLine(ReplacehtmlBody2(img));}public static string ReplaceRegex(string content, string regParen, string replyContent){string strOutput = System.Text.RegularExpressions.Regex.Replace(content, regParen, replyContent);return strOutput;}public static string ReplacehtmlBody(string htmlBody){if (string.IsNullOrWhiteSpace(htmlBody)){return htmlBody;}return ReplaceRegex(htmlBody, "(i?)(\\<img.*?style=['\"])([^\\>]+\\>)", "$2max-width: 80% !important;$3");}public static string ReplacehtmlBody2(string htmlBody){if (string.IsNullOrWhiteSpace(htmlBody)){return htmlBody;}var reg = new System.Text.RegularExpressions.Regex("(\\<img.*?style=['\"])([^\\>]+\\>)", System.Text.RegularExpressions.RegexOptions.IgnoreCase);return reg.Replace(htmlBody, "$1max-width: 80% !important;$2");}
}
<img style='max-width: 80% !important;aaa' />j<Img style='bbb' />k<img style='max-width: 80% !important;ccc' ></img>
i<img style='max-width: 80% !important;aaa' />j<Img style='max-width: 80% !important;bbb' />k<img style='max-width: 80% !important;ccc' ></img>
網(wǎng)站地址
地址:
https://dotnetfiddle.net/
總結(jié)
以上是生活随笔為你收集整理的.Net在线编辑工具.NET Fiddle的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。