S
Some Clown
If I have an array like so:
lineItems[MAX][MAX2];
which is of type char[] and I've filled it up with some stuff (filenames and
paths mostly,) how would I go about replacing a portion of each element?
For example, I've got "C:\somepath\morepath\filename" in lineItems[0] and I
want to replace it with "F:\shorterpath\filename"... I've thought about
creating another array, looping through and copying portions out to the new
array, but I'm not sure how efficient that would be. Is there some sort of
functionality somewhere to allow me to strip 'n' characters off of an array
element of type char[] and combine with new elements, then put back?
Like:
Loop 'n' times
strip 'i' number of chars from beginning of each element
replace with 'j' and remove whitespace
repeat
lineItems[MAX][MAX2];
which is of type char[] and I've filled it up with some stuff (filenames and
paths mostly,) how would I go about replacing a portion of each element?
For example, I've got "C:\somepath\morepath\filename" in lineItems[0] and I
want to replace it with "F:\shorterpath\filename"... I've thought about
creating another array, looping through and copying portions out to the new
array, but I'm not sure how efficient that would be. Is there some sort of
functionality somewhere to allow me to strip 'n' characters off of an array
element of type char[] and combine with new elements, then put back?
Like:
Loop 'n' times
strip 'i' number of chars from beginning of each element
replace with 'j' and remove whitespace
repeat