如何获取一个单词(表示为 char 数组)在段落中(同样表示为 char 数组)的索引。
char 表示该单词。
char word[] = new char[]{'w','o','r','d'};
and here's the paragraph
char para[] = new char[]{'f','g','q','z','y','i','o','p','w','o','r','d'};
我希望能够获取第一个字母的索引,即第8个。我尝试使用二分查找,但由于单词被打乱了,无法实现排序。
谢谢。