Start a new topic

New substr function in v0.46

Okay folks, we now have a new function substr in Nextion


Source

   t0.txt="The quick brown fox jumps over the lazy dog"

LEFT

 - substr t0.txt,t1.txt,0,9 // returns "The quick" to t1.txt

MID

 - substr t0.txt,t2.txt,16,10 // returns "fox jumped" to t2.txt

RIGHT

 - strlen t0.txt,sys0  // puts length of t0.txt into sys0

 - substr t0.txt,t3.txt,sys0-8,8 // returns "lazy dog" to t3.txt


Just remember that indexing starts with byte 0

So much can now be done with such a function. 

Happy coding =)


3 people like this idea
Login or Signup to post a comment