#Java 10, 141 bytes
Java 10, 141 bytes
s->c->{var r=s.split("\\"+c);var r=a[0],t;for(int i=0;++i<a.length;r+=t.isEmpty()?"":(char)(t.charAt(0)&~32)+t.substring(1))t=a[i];return r;}
Explanation:
s->c->{ // Method with String and character parameters and String return-type
var r=s.split("\\"+c); // Split String by character (with potential regex char)
var r=a[0], // Result-String, starting at the first item
t; // Temp-String to reduce bytes
for(int i=0;++i<a.length;// Loop in the range [1, length_of_array)
r+= // After every iteration: append the result-String with:
t.isEmpty()? // If the current item empty:
"" // Append nothing
: // Else:
(char)(t.charAt(0)&~32)
// Capitalize the first character
+t.substring(1)) // And append the other characters as is
t=a[i]; // Set `t` to the current String-item of the array
return r;} // Return the result-String
#Java 10, 141 bytes
s->c->{var r=s.split("\\"+c);var r=a[0],t;for(int i=0;++i<a.length;r+=t.isEmpty()?"":(char)(t.charAt(0)&~32)+t.substring(1))t=a[i];return r;}
Explanation:
s->c->{ // Method with String and character parameters and String return-type
var r=s.split("\\"+c); // Split String by character (with potential regex char)
var r=a[0], // Result-String, starting at the first item
t; // Temp-String to reduce bytes
for(int i=0;++i<a.length;// Loop in the range [1, length_of_array)
r+= // After every iteration: append the result-String with:
t.isEmpty()? // If the current item empty:
"" // Append nothing
: // Else:
(char)(t.charAt(0)&~32)
// Capitalize the first character
+t.substring(1)) // And append the other characters as is
t=a[i]; // Set `t` to the current String-item of the array
return r;} // Return the result-String
Java 10, 141 bytes
s->c->{var r=s.split("\\"+c);var r=a[0],t;for(int i=0;++i<a.length;r+=t.isEmpty()?"":(char)(t.charAt(0)&~32)+t.substring(1))t=a[i];return r;}
Explanation:
s->c->{ // Method with String and character parameters and String return-type
var r=s.split("\\"+c); // Split String by character (with potential regex char)
var r=a[0], // Result-String, starting at the first item
t; // Temp-String to reduce bytes
for(int i=0;++i<a.length;// Loop in the range [1, length_of_array)
r+= // After every iteration: append the result-String with:
t.isEmpty()? // If the current item empty:
"" // Append nothing
: // Else:
(char)(t.charAt(0)&~32)
// Capitalize the first character
+t.substring(1)) // And append the other characters as is
t=a[i]; // Set `t` to the current String-item of the array
return r;} // Return the result-String
#Java 10, 141 bytes
s->c->{var r=s.split("\\"+c);var r=a[0],t;for(int i=0;++i<a.length;r+=t.isEmpty()?"":(char)(t.charAt(0)&~32)+t.substring(1))t=a[i];return r;}
Explanation:
s->c->{ // Method with String and character parameters and String return-type
var r=s.split("\\"+c); // Split String by character (with potential regex char)
var r=a[0], // Result-String, starting at the first item
t; // Temp-String to reduce bytes
for(int i=0;++i<a.length;// Loop in the range [1, length_of_array)
r+= // After every iteration: append the result-String with:
t.isEmpty()? // If the current item empty:
"" // Append nothing
: // Else:
(char)(t.charAt(0)&~32)
// Capitalize the first character
+t.substring(1)) // And append the other characters as is
t=a[i]; // Set `t` to the current String-item of the array
return r;} // Return the result-String