String encodeString(String content, [ int lineSize = 0, int paddingSpace = 0 ])

Source

static String encodeString(String content,
    [int lineSize = 0, int paddingSpace = 0]) {
  return Base64.encode(toUTF8(content), lineSize, paddingSpace);
}