how can I write a program which convert a given string, it removing the leading and trailing space?


Example 1: (Let . be space)

......ABCD....EDE....2dkjl......kll##....

Result should be

ABCD....EDE....2dkjl......kll##

Example 2: (Let . be spare)

...A...WW..22...oo..888....0000...u....

Result should be

A...WW..22...oo..888....0000...u

My think is to use two-dimensional arrays to store the string, for ex.1

......
ABCD
....
EDE
....
2dkjl
......
kll##
....

and then remove the first and end arrays.
Can someone give me some hints on how to write the program? thank a lot.