简体   繁体   中英

Is there a length limit to String in Android?

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 could possible explain truncating my string?

它的logcat不能显示全文,将logcat的输出打印到文件中,我认为你应该能够看到整个String。

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

System.out.println (string);

outputs the whole string.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM