Longest common prefix: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 3,751: | Line 3,751: | ||
{{trans|go}} |
{{trans|go}} |
||
<lang vlang>// lcp finds the longest common prefix of the input strings. |
<lang vlang>// lcp finds the longest common prefix of the input strings. |
||
// It compares by bytes instead of runes (Unicode code points). |
|||
// It's up to the caller to do Unicode normalization if desired |
|||
// (e.g. see golang.org/x/text/unicode/norm). |
|||
fn lcp(l []string) string { |
fn lcp(l []string) string { |
||
// Special cases first |
// Special cases first |