count不是String的成员 [英] count is not member of String

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

问题描述

我已将行存储在数组中
并想要计算输出.
但是由于计数不是String的成员而出现错误

I have stored the lines in array
and want to count the output.
But am getting error as count is not member of String

Dim lines() As String
lines = File.ReadAllLines(Filepath)
Dim count As Integer = lines.Count

---在

lines.count


出现错误
问题出在哪里,请辅助



where is the problem please assist

推荐答案

ReadAllLines返回字符串数组.如果需要给定文件中的行数,请使用Length属性.
ReadAllLines returns an array of strings. If you need the number of lines in a given file, use Length property.


应该这样:

暗线作为String()
Shouldn''t that be:

Dim lines As String()


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

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