生活随笔
收集整理的這篇文章主要介紹了
.Net在线编辑工具.NET Fiddle
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
介紹
推薦工具:.NET Fiddle
推薦理由:在線調試,編譯,運行.net代碼,同時支持C#,VB.NET,F#
推薦說明::對于.NET開發(fā)者來說是福音,因為我們可以不用再擔心環(huán)境與龐大的IDE的問題,不管在任何時間,任何環(huán)境,如果有了什么點子,打開dotnetfiddle.net,輸入你的代碼;總的來說,它能夠讓你在瀏覽器窗體重復折騰代碼片段而無需運行Visual Studio。當你僅僅是調試少量代碼時這實在是太方便了。.NET Fiddle的一個最大賣點就是它是免費的。
網(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/
總結
以上是生活随笔為你收集整理的.Net在线编辑工具.NET Fiddle的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網(wǎng)站內容還不錯,歡迎將生活随笔推薦給好友。