您的目标是像
Pie is good. I just ate a bunch of pies early this morning. Actually, it was closer to the afternoon. Mornings are good.
并创建一个字符串索引数组,其中组成单词“ Llama”的字母出现(顺序一个)。例如,让我显示用尖号指向的字母以显示索引:
Pie is good. I just ate a bunch of pies early this morning. Actually, it was closer to the afternoon. Mornings are good.
^ ^ ^ ^ ^
所以数组看起来像:
[44, 67, 76, 105, 114]
(如果您的应用程序使用的索引不是基于0的,则数字看起来会有所不同。可以。)
如果文本中没有驼峰,则数组应为空,nil,null或未定义。
接受任何代码语言。这是一场代码高尔夫比赛,因此最少的字符获胜!