string str = "test.cs"; Debug.Log(str.EndsWith(".cs")); 判断字符串是不是以什么结尾的 str.LastIndexOf(’.’); 这个方法判断所指定的字符是位于字符串的第几位。