Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有一个lodash函数可以转换"répété" => "RÉPÉTÉ"而不是"REPETE" 由uppercase函数完成?
lodash
"répété" => "RÉPÉTÉ"
"REPETE"
uppercase
如果不是,那么在 Javascript 中执行此操作的简单方法是什么?
好吧,您有一个名为“toLocaleUpperCase()”的本机函数
你可以这样做:
const str = 'répété'; const ret = str.toLocaleUpperCase(); alert(ret);
文档:https ://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLocaleUpperCase
你可以使用toLocaleUpperCase()
toLocaleUpperCase()
const str = 'répété'; const ret = str.toLocaleUpperCase(); console.log(ret);