@@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
55you may not use this file except in compliance with the License.
66You may obtain a copy of the License at
77
8- http://www.apache.org/licenses/LICENSE-2.0
8+ http://www.apache.org/licenses/LICENSE-2.0
99
1010Unless required by applicable law or agreed to in writing, software
1111distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,37 +29,37 @@ import (
2929//
3030// Examples
3131//
32- // "" => [""]
33- // "lowercase" => ["lowercase"]
34- // "Class" => ["Class"]
35- // "MyClass" => ["My", "Class"]
36- // "MyC" => ["My", "C"]
37- // "HTML" => ["HTML"]
38- // "PDFLoader" => ["PDF", "Loader"]
39- // "AString" => ["A", "String"]
40- // "SimpleXMLParser" => ["Simple", "XML", "Parser"]
41- // "vimRPCPlugin" => ["vim", "RPC", "Plugin"]
42- // "GL11Version" => ["GL", "11", "Version"]
43- // "99Bottles" => ["99", "Bottles"]
44- // "May5" => ["May", "5"]
45- // "BFG9000" => ["BFG", "9000"]
46- // "BöseÜberraschung" => ["Böse", "Überraschung"]
47- // "Two spaces" => ["Two", " ", "spaces"]
48- // "BadUTF8\xe2\xe2\xa1" => ["BadUTF8\xe2\xe2\xa1"]
32+ // "" => [""]
33+ // "lowercase" => ["lowercase"]
34+ // "Class" => ["Class"]
35+ // "MyClass" => ["My", "Class"]
36+ // "MyC" => ["My", "C"]
37+ // "HTML" => ["HTML"]
38+ // "PDFLoader" => ["PDF", "Loader"]
39+ // "AString" => ["A", "String"]
40+ // "SimpleXMLParser" => ["Simple", "XML", "Parser"]
41+ // "vimRPCPlugin" => ["vim", "RPC", "Plugin"]
42+ // "GL11Version" => ["GL", "11", "Version"]
43+ // "99Bottles" => ["99", "Bottles"]
44+ // "May5" => ["May", "5"]
45+ // "BFG9000" => ["BFG", "9000"]
46+ // "BöseÜberraschung" => ["Böse", "Überraschung"]
47+ // "Two spaces" => ["Two", " ", "spaces"]
48+ // "BadUTF8\xe2\xe2\xa1" => ["BadUTF8\xe2\xe2\xa1"]
4949//
5050// Splitting rules
5151//
52- // 1) If string is not valid UTF-8, return it without splitting as
52+ // 1. If string is not valid UTF-8, return it without splitting as
5353// single item array.
54- // 2) Assign all unicode characters into one of 4 sets: lower case
54+ // 2. Assign all unicode characters into one of 4 sets: lower case
5555// letters, upper case letters, numbers, and all other characters.
56- // 3) Iterate through characters of string, introducing splits
56+ // 3. Iterate through characters of string, introducing splits
5757// between adjacent characters that belong to different sets.
58- // 4) Iterate through array of split strings, and if a given string
58+ // 4. Iterate through array of split strings, and if a given string
5959// is upper case:
60- // if subsequent string is lower case:
61- // move last character of upper case string to beginning of
62- // lower case string
60+ // if subsequent string is lower case:
61+ // move last character of upper case string to beginning of
62+ // lower case string
6363func Split (s string ) []string {
6464 // don't split invalid utf8
6565 if ! utf8 .ValidString (s ) {
0 commit comments