Alternate the case

Can someone help me with the problem
I have to convert alternate letters of sentence to uppercase also ignore the blank spaces
for eg
i/p we are the teams
o/p We ArE tHe TeAmS
Any help would be appreiciated