ExportString

ExportString[str, "format"] encodes str into "format".

Attributes[ExportString] := {Protected, ReadProtected}

Simple examples

In[1]:= ExportString["Hello World", "base64"]
Out[1]= "SGVsbG8gV29ybGQ=
"