how do i split a string into an array in the below way .
Lets say i have a string . “Hemanth” . I want a json string to be generated as follows .
[ { “splitStr”: [ “hem”, “ema”, “man”, “ant”, “nth” ] } ]
I know i can use some thing like -
select array substr(“hemanth”,i,3) for i in [0,1,2,3,4] end as splitStr
But i want [0,1,2,3,4] to be generated in dynamic way based on length of input string .
select array substr(,i,3) for i in [0,1,2,3,4] end as splitStr