Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4184
  • Last Modified:

Error:"constant string too long",

Hi all,

I'm trying to process a String that is approx 200,000 characters long. I know this is a huge 'string' but it is actually a representation of a document.

When I try to process this in JAVA I get the error

"java:6: constant string too long".

Is there an 'object' class along the lines of 'int' which is extended to 'long' for the string class?

Any help is much appreciated.
0
highlyevolved
Asked:
highlyevolved
  • 2
2 Solutions
 
Tommy BraasCommented:
The maximum length of a String in Java is 64kb (65535 characters).
0
 
Tommy BraasCommented:
You should be able to use the StringBuffer class.
0
 
CEHJCommented:
>>(65535 characters).

Wouldn't that be 128kb? That seems a strange size. Where is this defined o?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now