📜  如何以角度解码任何扩展的base64字符串 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:01:28.437000             🧑  作者: Mango

代码示例1
String[] strings = base64String.split(",");
String extension;
switch (strings[0]) {//check image's extension
    case "data:image/jpeg;base64":
        extension = "jpeg";
        break;
    case "data:image/png;base64":
        extension = "png";
        break;
    default://should write cases for more images types
        extension = "jpg";
        break;
}