Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

What is the maximum string length of a string variable on Android and iOS?
Started by troylyndon Mar 12 2019 12:28 AM

- - - - -
2 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 619 posts
  • Corona SDK

What is the maximum string length of a string variable on Android and iOS? Does anyone know?



[TOPIC: post.html]
#2

thomas6

[GLOBAL: userInfoPane.html]
thomas6
  • Contributor

  • 980 posts
  • Corona SDK

No idea, but I am curious as to why you need to know, and why you need looooooooooooooooooooong string sizes :-)



[TOPIC: post.html]
#3

Alan PlantPot

[GLOBAL: userInfoPane.html]
Alan PlantPot
  • Contributor

  • 920 posts
  • Corona SDK

According to posts on StackOverflow, they can theoretically hold 2-4 billion characters:  

https://stackoverflow.com/questions/6482641/what-is-the-maximum-length-of-an-nsstring-object

https://stackoverflow.com/questions/15369117/what-is-the-maximum-amount-of-data-that-a-string-can-hold-in-java

 

However as pointed out in the second link the OS will limit the heap to somewhere between 16-256MB, which leads to a practical limit of 4-64 million characters (I don't believe that Lua imposes any limits on top of these). If you need any more than that, I'd be shocked.




[topic_controls]
[/topic_controls]