哪里不是字符串的成员 [英] Where is not a member of string

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

问题描述

亲爱的所有人,



我们尝试使用以下功能从字符串中删除多余的空格。



 公共共享函数 RemoveWhitespace(fullString  As  String) As  String 
返回新字符串(fullString) 。其中功能(x) Char .IsWhiteSpace(x))。ToArray())
结束 功能







我们正在使用Visual Studio 1.0 Framework。



但我们收到错误哪里不是字符串成员。



请帮助



问候

Sreejith

解决方案

尝试:

 返回 regex.Replace(fullString,  \s 


Dear All,

We tried to remove extra spaces from a string using the below function.

Public Shared Function RemoveWhitespace(fullString As String) As String
        Return New String(fullString.Where(Function(x) Not Char.IsWhiteSpace(x)).ToArray())
    End Function




We are using Visual Studio 1.0 Framework.

But we are getting an error Where is not a member of string.

Please help

Regards
Sreejith

解决方案

Try:

Return regex.Replace(fullString, "\s", "")


这篇关于哪里不是字符串的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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