Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for makeStringFinder (0.43 sec)

  1. src/strings/export_test.go

    				s += r.printNode(t.table[m], depth+1)
    			}
    		}
    	}
    	return
    }
    
    func StringFind(pattern, text string) int {
    	return makeStringFinder(pattern).next(text)
    }
    
    func DumpTables(pattern string) ([]int, []int) {
    	finder := makeStringFinder(pattern)
    	return finder.badCharSkip[:], finder.goodSuffixSkip
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 1.1K bytes
    - Viewed (0)
  2. src/strings/search.go

    	// rightmost "abc" (at position 6) is a prefix of the whole pattern, so
    	// goodSuffixSkip[3] == shift+len(suffix) == 6+5 == 11.
    	goodSuffixSkip []int
    }
    
    func makeStringFinder(pattern string) *stringFinder {
    	f := &stringFinder{
    		pattern:        pattern,
    		goodSuffixSkip: make([]int, len(pattern)),
    	}
    	// last is the index of the last character in the pattern.
    	last := len(pattern) - 1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 18:49:51 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  3. src/strings/replace.go

    	// value is the new string that replaces that pattern when it's found.
    	value string
    }
    
    func makeSingleStringReplacer(pattern string, value string) *singleStringReplacer {
    	return &singleStringReplacer{finder: makeStringFinder(pattern), value: value}
    }
    
    func (r *singleStringReplacer) Replace(s string) string {
    	var buf Builder
    	i, matched := 0, false
    	for {
    		match := r.finder.next(s[i:])
    		if match == -1 {
    			break
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 17:10:31 UTC 2023
    - 14.5K bytes
    - Viewed (0)
Back to top