从字符串转换为整数 [英] converting from string to integer

查看:84
本文介绍了从字符串转换为整数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

如果我想从整数更改值并将其设置为字符串,则声明是什么?我曾经看到过使用CInt(CStr)进行转换,但是我不确定在哪个平台上进行转换.我来宾vb6.对于vb.net 2010,我注意到它使用ascw(label.text(count))..现在,如果有人知道我在哪里可以找到其他用于转换值的语法,例如:String,Double,Integer,请给我一个链接.我将不胜感激.

Hi all,

If i want to change the value from integer and set it as string, what is the declaration? I''ve used to see that to convert, by using CInt(CStr) but I''m not sure in what platform. I guest vb6. For vb.net 2010, I''m noticed that it using ascw(label.text(count)).. Right now, if someone know where i can find the other syntax for converting value eg: String, Double, Integer, please give me a link. I will be appreciate it.

推荐答案

使用Convert方法.
Use the Convert method.
Dim value as string
Dim result As Integer

result = Convert.ToInt32(value)



请参阅 http://msdn.microsoft.com/en-us/library/sf1aw27b.aspx#Y0 [^ ] .



See http://msdn.microsoft.com/en-us/library/sf1aw27b.aspx#Y0[^].


这篇关于从字符串转换为整数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆