E
elingtse
HI all,
I need to replace a tab for every 4 consecutive spaces for a statement
which is included in an array. I've set another index array to mark
whether the content is space, if the index become 4, if change to tab.
But it seems hard to go back the previous index to delete the previous
spaces in a for loop. Could anyone give me some hints ? Thanks a lot.
Statement Example :
s = space
t = tab
X = content
sssssssssXXXXXssssssXXXXXX
Expected Solution :
ttsXXXXXtssXXXXXX
(replace every consecutive 4 space into tab)
et
I need to replace a tab for every 4 consecutive spaces for a statement
which is included in an array. I've set another index array to mark
whether the content is space, if the index become 4, if change to tab.
But it seems hard to go back the previous index to delete the previous
spaces in a for loop. Could anyone give me some hints ? Thanks a lot.
Statement Example :
s = space
t = tab
X = content
sssssssssXXXXXssssssXXXXXX
Expected Solution :
ttsXXXXXtssXXXXXX
(replace every consecutive 4 space into tab)
et