本文介绍了如何将int类型转换为字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我是shailendra singh.任何人都可以帮助我.我为此代码而苦. lblEtotal=(Convert.ToString((lblEW.Text) + (lblEfa1.Text) + (lblEfa11.Text)));
我想将此代码转换为字符串,但标签无法转换.如何将数据,lblEtotal,lblEw,lblEfa1,lblEfa11转换为标签.请帮助我.
感谢您的进步.
Hi
I am shailendra singh .any one help me .I am suffering for this code . lblEtotal=(Convert.ToString((lblEW.Text) + (lblEfa1.Text) + (lblEfa11.Text)));
I want to covert this code int to string but label cannot covert .how can covert data ,lblEtotal,lblEw,lblEfa1,lblEfa11 are label .please help me .
Thanks for advance.
推荐答案
lblETotal.Text = (int.Parse(lblEW.Text) + int.Parse(lblEfa1.Text) + int.Parse (lblEfa11.Text)).ToString();
[edit]忘记了标签输出中的.Text:O-OriginalGriff [/edit]
[edit]Forgot the .Text on the label output :O - OriginalGriff[/edit]
lblEtotal.Text=(int.Parse(lblEW.Text) + int.Parse(lblEfa1.Text) + int.Parse(lblEfa11.Text)).ToString();
int n1, n2, n3;
if (int.TryParse(lblEW.Text, out n1) && int.TryParse(lblEfa1.Text, out n2)) && int.TryParse(lblEfa11.Text, out n3))
lblEtotal.Text= (n1+n2+n3).ToString;
希望对您有所帮助.
Hope it helps.
这篇关于如何将int类型转换为字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!