Quote:
Because this sentence may increases .And with Splitting and mapping may decrease performance
Do you write this because you know another way that perform better ? if so, program it.
- Simple minded method: Take the sentence and search a given word using standard function. Search "fund" in "I have made a crowdfunding.", you will have a match, but is it what you want ? You need to check for spaces before and after the word unless it is the first or last one. Is it still the easy way.
- split method: you split the sentence in words only once. Each list entry is a word, you just have to check if a list entry is equal to a word or not, no special cases.
Use the split method. when you think of a better method, try it and compare the performance results. and tell us.