草庐IT

txtPriceLimit

全部标签

c# - 在 C# 中获取 String.indexof 之后的字符串

我目前正在用C#开发一个应用程序,我需要在该应用程序中获取字符串中某个字符之后的子字符串。elseif(txtPriceLimit.Text.Contains('.')&&char.IsNumber(e.KeyChar)){intindex=txtPriceLimit.Text.IndexOf('.');stringpennies=txtPriceLimit.Text.Substring(index,txtPriceLimit.Text.Length);Console.WriteLine("Pennies:"+pennies);}出于某种原因,它不断出现IndexOutOfRangeE