Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for CamelCaseWithSeparator (0.13 sec)

  1. pkg/util/strcase/camelcase.go

    		for i+1 < len(s) && isASCIILower(s[i+1]) {
    			i++
    			t = append(t, s[i])
    		}
    	}
    	return string(t)
    }
    
    // CamelCaseWithSeparator splits the given string by the separator, converts the parts to CamelCase and then re-joins them.
    func CamelCaseWithSeparator(n string, sep string) string {
    	p := strings.Split(n, sep)
    	for i := 0; i < len(p); i++ {
    		p[i] = CamelCase(p[i])
    	}
    	return strings.Join(p, "")
    }
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Feb 28 19:48:10 UTC 2020
    - 2.7K bytes
    - Viewed (0)
  2. pkg/util/strcase/camelcase_test.go

    				n:   "foobar",
    				sep: "",
    			},
    			want: "FOOBAR",
    		},
    	}
    	for _, tt := range tests {
    		t.Run(tt.name, func(t *testing.T) {
    			if got := CamelCaseWithSeparator(tt.args.n, tt.args.sep); got != tt.want {
    				t.Errorf("CamelCaseWithSeparator() = %v, want %v", got, tt.want)
    			}
    		})
    	}
    }
    
    func Test_isWordSeparator(t *testing.T) {
    	tests := []struct {
    		name string
    		c    byte
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Oct 31 14:48:28 UTC 2023
    - 3.8K bytes
    - Viewed (0)
Back to top