How to convert a string to a material or texture?

Could you elaborate?

Like are you trying to save material parameters, or are you trying to save a reference to a material/texture, or something else?

The title is not very descriptive. Please say what the purpose is.