How to Convert a String to LongTensor, and Back?

If you could give some examples of the kind of conversion that you are after, then I can try finding a way to do that.