Google Apps脚本中字符串的最大大小是多少? [英] What is the max size of a string in Google Apps Script?
本文介绍了Google Apps脚本中字符串的最大大小是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将Gmail附件中的csv文件导入到现有的Google电子表格中.
I'm importing csv files from Gmail attachments into an existing Google Spreadsheet.
我使用getDataAsString()来保存整个csv内容.我已经尝试过将其大小更改为大约6000个字符.此字符串最多可以容纳多少个字符?
I use the getDataAsString() to hold the entire csv contents. I've tried it varying sizes up to ~6000 characters. Is there a maximum number of characters this string can take?
推荐答案
Google Apps脚本中的字符串限制为 67,108,864(6700万)个字符.您可以使用以下功能自己尝试:
The limit for strings in Google Apps Script is 67,108,864 (67 million) characters. You can try it yourself with this function:
function strtest() {
var str = "a";
while (1) {
str = str + str;
}
}
输出:
I am not sure if there is a way to increase this through other means (for example, there is a fix for this in Wordpress).
这篇关于Google Apps脚本中字符串的最大大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文