We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey,
I'm using p5.js and would like to split a string I get from JSON data when it gets to a certain length. At the moment I can see that split() needs a specific character to split the string. Is there a way to split a string after say a number of characters (i.e. split the string after 40 chars) or a width (i.e. split the string after 800px).
I know that it is possible to do this in javascript (thanks google) but I wouldn't know how to integrate this into P5.JS.
help much appreciated
Thank you :)
Answers
There are String's methods substring() & substr():
That worked. thanks (I din't realise you could just use JS stuff directly with P5.js...useful to know though!
Yep! Same for standard Processing, but the Java API instead: ~O)