kirillrakhman
02/16/2016, 3:05 PMcbruegg
02/16/2016, 3:06 PMcbruegg
02/16/2016, 3:07 PMcbruegg
02/16/2016, 3:11 PMkirillrakhman
02/16/2016, 3:12 PMkirillrakhman
02/16/2016, 3:12 PMcbruegg
02/16/2016, 3:13 PMkirillrakhman
02/16/2016, 3:13 PMcbruegg
02/16/2016, 3:14 PMsequence
is now called generateSequence
, it invokes the lambda until it returns null.cbruegg
02/16/2016, 3:14 PMcbruegg
02/16/2016, 3:18 PMkirillrakhman
02/16/2016, 3:20 PMkirillrakhman
02/16/2016, 3:22 PMkirillrakhman
02/16/2016, 3:24 PMfor (i in pattern.indices)
cbruegg
02/16/2016, 3:25 PMkirillrakhman
02/16/2016, 3:26 PMkirillrakhman
02/16/2016, 3:26 PMkirillrakhman
02/16/2016, 3:26 PMkirillrakhman
02/16/2016, 3:26 PMkirillrakhman
02/16/2016, 3:26 PMkirillrakhman
02/16/2016, 3:26 PMkirillrakhman
02/16/2016, 3:27 PMkirillrakhman
02/16/2016, 3:27 PMfor (i in 1..pattern.length - 1)
cbruegg
02/16/2016, 3:28 PMilya.gorbunov
02/16/2016, 3:45 PMmvn compile -pl :kotlin-stdlib -am
cbruegg
02/16/2016, 3:45 PMcbruegg
02/16/2016, 3:46 PMilya.gorbunov
02/16/2016, 3:59 PMindexOfAny
and findAnyOf
do?
- what are the use-cases where it would be beneficial to use occurrencesOf
instead of indexOf
?cbruegg
02/16/2016, 4:14 PMk
in a long text of length n
, which would be O(nk) with indexOf
, but is O(n) with occurencesOf
. A more concrete use case: Suppose we have a large number of texts (like a search engine) we would like to run a search query against. With occurencesOf
, we could get all relevant parts of the text very efficiently, maybe get a substring of the occurence 100 chars before and after, obtaining a summary of where the word occurs.cbruegg
02/16/2016, 4:36 PMignoreCase
parameter.