判断string类型的数据末端字符是否为制定字符
string.EndsWith("");
string testA="XiaoMing_Student";
string testB="LiHua_Teacher";
public void Judge()
{
if (testA.EndsWith("_Student"))
{
Debug.Log(testA+"是学生");
}
if (testB.EndsWith("_Teacher"))
{
Debug.Log(testB+"是老师");
}
}
2188



被折叠的 条评论
为什么被折叠?



