包含「js」标签的文章 - 共计2篇

2024-03-20
问题 有字符串“../../img/example.jpg”,想要提取出文件名example,使用js代码replace替换../../img/,再使用substring提取文件名时出现问题 js const str = '../../img/example.jpg' console.log(str.replace('../../img/','')).substring(0,str.lastIndexOf('.')) // example.jpg 无法去除后缀名,而当两者分开使用时可以正常出
2023-11-10
背景 数据库存储有这类JSON数据,希望在输出时将每个子项都单独输出并根据key值重命名 json softtissue:{ nasalBase:{ Col_Sn_Ls:null, N_Prn_Sn:null, ZyR_Prn_ZyL:null, Sn_N_Pg:null, A_NPg:null, Col_Sn:null, Prn_Sn:null, AIR_AIL:null, AcR_AcL:null, other:"" }, upperLipAn
copyright  2024   @ Cardy
Powered by Astro | Theme Cloud