File.ReadAllLines()和File.ReadAllText()有什么区别? [英] What is the difference between File.ReadAllLines() and File.ReadAllText()?

查看:138
本文介绍了File.ReadAllLines()和File.ReadAllText()有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

File.ReadAllLines() File.ReadAllText()有什么区别?

推荐答案

ReadAllLines 返回字符串数组。每个字符串包含文件的一行。

ReadAllLines returns an array of strings. Each string contains a single line of the file.

ReadAllText 返回包含文件所有行的单个字符串。

ReadAllText returns a single string containing all the lines of the file.

这篇关于File.ReadAllLines()和File.ReadAllText()有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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