【发布时间】:2014-02-16 20:28:02
【问题描述】:
我在网上找到了这个:
char[] characters = "this is a test".ToCharArray();
但是这个存储在一个char 数组中。我希望能够将其存储到 String 数组中,因为我使用的函数仅适用于 String。
或者有没有另一种方法将所有字母放在一个数组中,然后选择一个数组的索引,其中值与数组中的字母相同。
像这样:
String[] alphabet = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", " "};
现在char[] 的第一个字母将是"t"。
现在我需要的是要存储在列表中的索引:19。
【问题讨论】: