我只想从数组中查找前三个字符的字符串索引
我有一个月的数组
string[] arrayEnglishMonth = { "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER" };
如果我写
int t_ciMonth=8;(AUGUST)
int pos = Array.IndexOf(t_caMonth, arrayEnglishMonth[t_ciMonth - 1]);
但是如果我只想要前 3 个字符的索引,即 AUG,如何找到它?