The most efficient way to search for an array of strings in another string

后端 未结 8 2369
礼貌的吻别
礼貌的吻别 2021-02-12 15:12

I have a large arrray of strings that looks something like this: String temp[] = new String[200000].

I have another String, let\'s call it bigtext. What I ne

8条回答
  •  我在风中等你
    2021-02-12 16:01

    That is a very efficient approach. You can improve it slightly by only evaluating temp.length once

    for(int x = 0, len = temp.length; x < len; x++)
    

    Although you don't provide enough detail of your program, it's quite possible you can find a more efficent approach by redesigning your program.

提交回复
热议问题