You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Azure Data Explorer中如何实现字符串首字母大写?

在Azure Data Explorer中实现字符串首字母大写

在Azure Data Explorer的Kusto查询语言里,你可以通过组合几个内置字符串函数快速实现字符串首字母大写的需求,核心逻辑是提取首字符转大写后,拼接剩余的子串。

完整示例代码

let Table = datatable(text: string)[
"hello",
"world",
"azure data explorer"
];
Table
| project capitalized_text = strcat(toupper(substring(text, 0, 1)), substring(text, 1))

各函数作用说明

  • substring(text, 0, 1):提取目标字符串的第一个字符
  • toupper():将提取的首字符转换为大写格式
  • substring(text, 1):提取字符串从第二个字符开始到末尾的所有内容
  • strcat():把大写后的首字符和剩余子串拼接成最终的首字母大写字符串

执行结果

capitalized_text
----------------
Hello
World
Azure data explorer

内容的提问来源于stack exchange,提问作者Daniel Dror

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 22:12:01