开发者

get only third line data of a file in android

开发者 https://www.devze.com 2023-01-15 05:28 出处:网络
In my android app i am reading a file but require anly the data on third line to be displayed.Is th开发者_StackOverflow社区ere any way to do that.

In my android app i am reading a file but require anly the data on third line to be displayed.Is th开发者_StackOverflow社区ere any way to do that.

Please forward your suggestion:)

Thanks in advance.


Not to be too specious, but.....

String str = InputStream.readline();
str = InputStream.readline();
str = InputStream.readline();

Now you have your string ;)

Just be happy that you don't need the thousandth string. (of course, enclosing this is a parameterized for loop would solve that problem)

0

精彩评论

暂无评论...
验证码 换一张
取 消