修剪不是char的成员吗? [英] trim is not a member of char?

查看:125
本文介绍了修剪不是char的成员吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
是vb.net的新功能,
我在应用程序中遇到以下错误.
我无法确切找出此错误是什么
我的错误是:
Trim不是char的成员

错误点是:
accountnumber.Trim

我的代码是:

hi all,
am new in vb.net,
i got the below error in my application.
i cant able to find out what is this error exactly
my error is:
Trim is not a member of char

error point is :
accountnumber.Trim

my code is :

Public Function FnAuthenticateUser(ByVal accountnumber As Char, ByVal password As String) As Array

       Dim inputparavalue() As String = {accountnumber.Trim, password.Trim}


最终功能

请放弃任何解决方案.
在此先感谢...


End Function

please drop any solution.
thanks in advance...

推荐答案

否,Trim不是Char的成员.

修剪适用于字符串-删除不需要的前导和尾随字符.字符是固定大小的-一个字符-因此无法修剪.

为什么您的帐号是一个字符?如果您怀疑它可能有前导或尾随空格,则应为字符串.如果它是数字,则可能应该是整数,它也不需要或不支持Trim方法.
No, Trim is not a member of Char.

Trim applies to Strings - it removes unwanted leading and trailing characters. Char is a fixed size - one character - so it cannot be trimmed.

Why is your account number a Char? if you suspect it may have leading or trailing spaces, the it should be a string. If it''s a number, then it probably should be an Integer, which also does not need or support a Trim method.


除了OriginalGriff,我建议您尝试了解一下错误的意思.它不仅是一条消息,而且是一个有含义的句子.如果显示"Trim不是成员",则表示"Trim不是成员",因此您不能像在代码中那样使用它作为成员:"accountNumber(which is char).Trim".此时您应该做什么:
1-打开msdn并在其中找到您的主题,然后查看其属性,方法等.
2-再次考虑您的目标,以查看您的代码是否符合您的意图.

我认为您没有使用Visual Studio IDE.我强烈建议您使用它,因为与您的情况一样,它具有许多优点.这是:
http://www.microsoft.com/en-us/download/details.aspx? id = 40787 [^ ]
in addition to OriginalGriff, I advice you to try to understand what an error means. It is not just a message, but it is a sentence with a meaning. If it says "Trim is not a member", then it means "Trim is not a member", therefore you cannot use it as if it is a member what you do in your code: "accountNumber(which is char).Trim". what you should do at this point:
1- open msdn and find out your subject in there, then see its properties, methods etc.
2- think of your aim again to see if your code matches your intention.

I think you are not using the Visual Studio IDE. I strongly advice to use it, because it has many advantages as in your case. here it is:
http://www.microsoft.com/en-us/download/details.aspx?id=40787[^]


错误非常明显. char类型没有名为Trim ...
的属性或方法.
字符代表单个Unicode字符... http://msdn.microsoft.com/zh-cn/library/7sx7t66b.aspx [ ^ ],所以没有修剪"它的概念

我怀疑您打算像这样传递参数
The error is quite clear. The char type does not have a property or method called Trim ...

A char represents a single Unicode character ... http://msdn.microsoft.com/en-us/library/7sx7t66b.aspx[^] so there is no concept of "trimming" it

I suspect you meant to pass the parameter like this
ByVal accountnumber As String


这篇关于修剪不是char的成员吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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