is is possible to split() from the nth character?

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 :)

Sign In or Register to comment.