Get Array Count with arrays within arrays
-
Get Array Count gives a blank value when it tries to get the count of an array that has arrays in it. Take this array for example and try to get the count of it:
["["array11","array12"]","["array21","array22"]"]
The result is nothing, but it should be 2. -
@Aidan-Oxley you need to escape the quotation marks so hyperPad knows that they are not part of the main array. It should be
["[\"Array11\",\"Array12\"]","[\"Array21\",\"Array22\"]"] -
Oh, if I read through the other forum posts about arrays more carefully I would've read about the slashes.
-
I actually didn't know about the backwards slashes :thinking: it makes sense though because backslashes are known as escape strings.
-
Wow, you don't need to escape them I think. I just used hyperPad to create the arrays rather than trying to type the array out, and it gave me this:
[["array11","array12"],["array21","array22"]]
Get Array Count gives 2 -
@Aidan-Oxley interesting, I think it doesn't need to escape them there because it's not putting quotation marks around the inner arrays. I guess that makes sense, but escaping them should work too I think.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login