我必须获取或计算多个字符串中有多少个字符。例子:
var aText = [
"There are only 2 types of people in the world:",
"Girls and boys, any other thing? I don't know."
];
Run Code Online (Sandbox Code Playgroud)
两个字符串加起来超过 80 个字符。另一个注意事项是字符串可能不固定,因为它们可能会增加或减少。有没有办法在 JavaScript 中做到这一点?
我尝试使用aText.length,但这只返回变量中的字符串数量。在本例中只有 2 个。
javascript ×1