跳到主要内容
2024年开发商调查到此,我们希望听到您的意见! 参加2024年开发商调查
删除了Peter Mortensen所做的一些无用的编辑
来源 链接

你能做到的str.replace(str[0],str[0].toUpperCase()).

检查此示例:

let str=“你好, 世界!"世界”让newStr=str.replace(str[0],str[0].toUpperCase())console.log(“str:”,str)console.log(“newStr:”,newStr)

你能做到的str.replace(str[0],str[0].toUpperCase()).

检查此示例:

let str=“你好, 世界!"让newStr=str.replace(str[0],str[0].toUpperCase())console.log(“str:”,str)console.log(“newStr:”,newStr)

你能做到的str.replace(str[0],str[0].toUpperCase())

检查此示例:

let str=“你好世界”让newStr=str.replace(str[0],str[0].toUpperCase())console.log(“str:”,str)console.log(“newStr:”,newStr)

主动阅读[<https://en.wikipedia.org/wiki/%22你好,_World!%22_程序>]。
来源 链接
彼得·莫特森
  • 31.3万
  • 22
  • 109
  • 132

你能做到的str.replace(str[0],str[0].toUpperCase()).

检查此示例:

let str=“你好, 世界”世界!"让newStr= str.replace(str[0],str[0].toUpperCase())console.log(“str:”, 字符串)console.log(“newStr:”, 新Str)

你能做到的str.replace(str[0],str[0].toUpperCase())

检查此示例:

let str=“你好世界”让newStr= str.replace(str[0],str[0].toUpperCase())console.log(“str:”,str)console.log(“newStr:”,newStr)

你能做到的str.replace(str[0],str[0].toUpperCase()).

检查此示例:

let str=“你好, 世界!"让newStr=str.replace(str[0],str[0].toUpperCase())console.log(“str:”, 字符串)console.log(“newStr:”, 新Str)

来源 链接

你能做到的str.replace(str[0],str[0].toUpperCase())

检查此示例:

let str=“hello WORLD”让newStr=str.replace(str[0],str[0].toUpperCase())console.log(“str:”,str)console.log(“newStr:”,newStr)