本文介绍了PadRight不能运行asp.net Web表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 您好! 这些是我的字符串; str1 =(_ averagekids + / - )。ToString()。PadRight( 7 )); str2 =(_ averageadults + / - )。ToString()。PadRight( 7 )); 当我运行代码时输出正确: 600 / - 45 / - 输出错误: 1100 / - 45 / - 无法得到,最新消息?提前谢谢解决方案 试试下面的代码,这应该适合你,它会在字符串 str1 =之后添加padd (_averagekids + / - )。ToString()。PadRight( 7 ,' ')); str2 =(_ averageadults + / - )。ToString()。PadRight( 7 ,' ')); 我找到了解决方案,它只能用于 str1 =((_ averagekids +/-\").Trim().ToString ())PadLeft(7)); Hello!These are my strings;str1=(_averagekids + "/-").ToString().PadRight(7));str2=(_averageadults + "/-").ToString().PadRight(7));when i run the code it is correct for the output:600/- 45/-but wrong for output:1100/- 45/-cant get ,whats going on? thanks in advance 解决方案 Hi, try the below code, this should work for you, it will add padd after the stringstr1=(_averagekids + "/-").ToString().PadRight(7, ' '));str2=(_averageadults + "/-").ToString().PadRight(7, ' '));i found solution , it is working only withstr1=((_averagekids + "/-").Trim().ToString()).PadLeft(7)); 这篇关于PadRight不能运行asp.net Web表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-13 12:03