首字母大写
//如果是小写字母, 则变换为大写字母

func strFirstToUpper(str string) string {
	if len(str) < 1 {
		return ""
	}
	strArry := []rune(str)
	if strArry[0] >= 97 && strArry[0] <= 122  {
		strArry[0] -= - 32
	}
	return string(strArry)
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
  • 2021-09-23
  • 2021-06-04
  • 2021-07-10
  • 2021-11-25
猜你喜欢
  • 2022-12-23
  • 2021-12-28
  • 2021-09-14
  • 2021-11-09
  • 2021-07-09
  • 2022-12-23
相关资源
相似解决方案