C#. String字串取代應用
text.Replace("被取代'","新字串");
後者字串取代前者text = text.Replace("<img", @"<img class=""rwd-img""");
以下是讀取HTML檔案把一些語法用字串取代成想要的語法
1 | string text = System.IO.File.ReadAllText(ConfigPath, System.Text.Encoding.Default); |
text.Replace("被取代'","新字串");
後者字串取代前者text = text.Replace("<img", @"<img class=""rwd-img""");
1 | string text = System.IO.File.ReadAllText(ConfigPath, System.Text.Encoding.Default); |
留言