c# Regex match and replace using function

前端 未结 2 693
抹茶落季
抹茶落季 2021-01-27 00:29
/// 
/// Given HTML overlay for an image in the store, render it.
/// [p:n] renders as price for item ID n
/// 
/// Rendere         


        
2条回答
  •  春和景丽
    2021-01-27 01:12

    I'm not totally sure I understand you, so bear with me if I am off.

     Console.WriteLine(int.Parse("$1"));  //throws exception Input string was not in a correct format.
    
     Console.WriteLine(int.Parse("$1".Replace("$", "")));  //Result: 1
    

    If Store.CommonFunctions.GetItemPriceOnDate returns a string, you should be good to go.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题