hey…
id like some help with a coding problem =)
i have a var lets say ‘x’
x=“i like cheese and want to eat it everyday”
i want to split the var x by every 10’th character, assuming the 10 chracter is not in the middle of a word , then i want it to split it before that so that no words are not cut out…
ex:
x=“i like cheese and want to eat it everyday”
arr[1]="i like " 7chars causs 10th char was inside ‘cheese’ and spliting of words is not allowed
arr[2]="cheese and " 10 chars exactly , splits at space
arr[3]="want to " 8 chars 10th char inside eat … u get the idea by now i hope =)
arr[4]="eat it "
arr[5]=“everyday”
so its splitting the variable every 10th character… if the 10th chracter is a space, if it is not it backs up to the previous space and for the next array slot starts from there
hope this makes sense =)
been trying to figure this out for a while now with no luck, hoping the geniuses at kirupa can