Many iPhone apps support the Open In... menu. See some examples.
If you have an email with plain text attachments, simply tap and hold it.
Use the Open In "Textastic" command if available, or the Open In... menu to open this attachment in Textastic.