开发者

Is there a length limit to String in Android?

开发者 https://www.devze.com 2023-02-17 01:02 出处:网络
I managed to read a web page into a string, but when I print it to LogCat, using Log.d(), It always displays less than what\'s really on that page.

I managed to read a web page into a string, but when I print it to LogCat, using Log.d(), It always displays less than what's really on that page.

Which leads me to suspect that one (or more) of the following are possible explanations:

  1. In Android, a String can grow dynamically, but it is eventually bound by some hard coded MAX_LENGTH.
  2. Log.d() is the one truncating a String output.

Is there a length limit to a String in Android?

If not, what c开发者_如何学运维ould possible explain truncating my string?


Its the logcat that is not able to display whole text , print the output of the logcat to a file , I think you should be able to see the whole String.


True, Log.d() truncates the tail end above some MAX_LENGTH, but

System.out.println (string);

outputs the whole string.

0

精彩评论

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

关注公众号