【Mathematica】如何处理字母大小写

时间:2024-10-12 02:13:13

1、把一句话的首字母变成大写字母:Capitalize[&孥恶膈茯quot;this is a pi."]。

【Mathematica】如何处理字母大小写

2、Capitalize的作用,是首字母大写。如果需要所有的字母变成大写,需要用ToUpperCase:ToUpperCase["this is a pi."]。

【Mathematica】如何处理字母大小写

3、把所有字母变成小写字母,用ToLowerCase:To雉搽妤粲LowerCase["THIS IS A PI."]。

【Mathematica】如何处理字母大小写

4、看看第一个希腊字母的大写符号:ToUpperCase["α"]。

【Mathematica】如何处理字母大小写

5、这个符号不是英文字母A:ToLowerCase["\[CapitalAlpha]"]。

【Mathematica】如何处理字母大小写

6、判断字母是否大写:UpperCaseQ["A"]。

【Mathematica】如何处理字母大小写

7、字符串里面只要有小写字母,就会返回否定结果:UpperCaseQ["ABc"]。

【Mathematica】如何处理字母大小写

8、数字也会被判定为非大写字母:UpperCaseQ["AB123"]。

【Mathematica】如何处理字母大小写

9、判断小写字母,用LowerCaseQ。字母不只是26个英文字母,还包括很多其它字母。

【Mathematica】如何处理字母大小写
© 手抄报圈