This illustrator tutorial shows how to create sliced text effect. Since the effect is live, the text is editable. The effect works for a single line. it can be saved to styles panel and used for other text.
How to make gradient text in illustrator
The tutorial shows how to apply a gradient fill to live text in illustrator. You can still edit text after making the gradient fill. Basically, In order to make the gradient, you should add fill color using appearance panel.