[Question]
  [
Given a string, capitalize it. By capitalization I mean `conTeNT-lENgth` changes to `Content-Length`. In the example I showed the string with 2 words with `-` as the word boundary. However I expect you to write the code for the string containing any number of words separated by a **single** character as the boundary. This boundary may change across the string.
**Conditions**
1. using `regular expressions` is **not allowed**.
2. there could be any number of words in a sentence(string).
3. each word will consist of `English` letters`[a-zA-Z]` of any case.
4. different words in the sentence will be separated by a single character. This character will **only** be any one of `-`, `.`, `¬†`, `/`, `&`, `#`. You can safely assume that sentence will **not** contain any other character except the mentioned ones.
5. word boundaries should be preserved in the output.
6. shortest code wins.
For example your program should output `Begin/With.Type&Content` for `BeGin/wITH.tyPE&conTeNt`.
```
Some test cases:
 "aGeNT ACcEpT/LEngTh-tYPe USeR raNgE.TyPe" 
 "type&AgeNt/CC/COnteNt lEnGth#acCePT/AgeNt.RAnGe-Cc/contEnt/cODe" 
 "cc/rEspoNCe.lEngtH#tYpE-witH&UsEr/bEgIN&uSer.AGEnT&begIn/aCCEPt/Cc" 
 "lENgTH#USeR.tYpE/BeGiN&LENGth tYpe/ACCEpt#rANge/codE&AnD-ACCepT/ConTenT" 
 "contENT/ACcEpT" 
 "BeGin/wITH.tyPE&conTeNt"
 "Code.cc#User.lenGTh-USer-AND&tyPE TypE&leNgtH.tYPe usER.UseR&with" 
 "RaNgE&COnTeNT WITh CoNTENT-TypE tyPe"
 "BEgin COdE#uSeR#aGeNt.USeR"
 "TypE LENGth"
```
  
[Answer]
**Python 3,22** 
```
print(input().title())
```
This code will take a string as input from stdin and gives a capitalized output to stdout.
for example:
input:
```
BEGIN/wITH.tyPe&cOnTENt
```
ouput:
```
Begin/With.Type&Content
```
The following code is for multi-line inputs (if necessary)
**Python 3, 46**
```
import sys
for i in sys.stdin:print(i.title())
```
[Answer]
# [05AB1E](http://github.com/Adriandmen/05AB1E), 1 byte
Code:
```
‚Ñ¢
```
Explanation:
```
‚Ñ¢   # Implicit input which is converted to title case.
```
[Try it online!](http://05ab1e.tryitonline.net/#code=4oSi&input=Y2MvckVzcG9OQ2UubEVuZ3RII3RZcEUtd2l0SCZVc0VyL2JFZ0lOJnVTZXIuQUdFblQmYmVnSW4vYUNDRVB0L0Nj)
[Answer]
### GolfScript, 36 27 19 characters
```
0\{95&+.47>32*\}%\;
```
A quite basic GolfScript approach which works for all input according to the specification. The examples can be tested [online](http://golfscript.apphb.com/?c=ezBcezk1JisuNDc%2BMzIqXH0lXDtwdXRzfTpmOwoKImFHZU5UIEFDY0VwVC9MRW5nVGgtdFlQZSBVU2VSIHJhTmdFLlR5UGUiIGYKInR5cGUmQWdlTnQvQ0MvQ09udGVOdCBsRW5HdGgjYWNDZVBUL0FnZU50LlJBbkdlLUNjL2NvbnRFbnQvY09EZSIgZgoiY2MvckVzcG9OQ2UubEVuZ3RII3RZcEUtd2l0SCZVc0VyL2JFZ0lOJnVTZXIuQUdFblQmYmVnSW4vYUNDRVB0L0NjIiBmCiJsRU5nVEgjVVNlUi50WXBFL0JlR2lOJkxFTkd0aCB0WXBlL0FDQ0VwdCNyQU5nZS9jb2RFJkFuRC1BQ0NlcFQvQ29uVGVuVCIgZgoiY29udEVOVC9BQ2NFcFQiIGYKIkJlR2luL3dJVEgudHlQRSZjb25UZU50IiBmCiJDb2RlLmNjI1VzZXIubGVuR1RoLVVTZXItQU5EJnR5UEUgVHlwRSZsZU5ndEgudFlQZSB1c0VSLlVzZVImd2l0aCIgZgoiUmFOZ0UmQ09uVGVOVCBXSVRoIENvTlRFTlQtVHlwRSB0eVBlIiBmCiJCRWdpbiBDT2RFI3VTZVIjYUdlTnQuVVNlUiIgZgoiVHlwRSBMRU5HdGgiIGY%3D&run=true).
[Answer]
## JavaScript (94)
```
prompt().split(l='').map(function(a){return l='A'>l?a.toUpperCase():a.toLowerCase()}).join('')
```
[Answer]
# Mathematica 62
**Data**
```
tests={"aGeNT ACcEpT/LEngTh-tYPe USeR raNgE.TyPe","type&AgeNt/CC/COnteNt lEnGth#acCePT/AgeNt.RAnGe-Cc/contEnt/cODe","cc/rEspoNCe.lEngtH#tYpEwitH&UsEr/bEgIN&uSer.AGEnT&begIn/aCCEPt/Cc","lENgTH#USeR.tYpE/BeGiN&LENGth tYpe/ACCEpt#rANge/codE&AnD-ACCepT/ConTenT","contENT/ACcEpT","BeGin/wITH.tyPE&conTeNt","Code.cc#User.lenGTh-USer-AND&tyPE TypE&leNgtH.tYPe usER.UseR&with","RaNgE&COnTeNT WITh CoNTENT-TypE tyPe","BEgin COdE#uSeR#aGeNt.USeR","TypE LENGth"}
```
---
**Code**
```
StringReplace[ToLowerCase@#,WordBoundary~~x_:>ToUpperCase@x]&
```
---
**Usage**
```
f["aGeNT ACcEpT/LEngTh-tYPe USeR raNgE.TyPe"]
```
> 
> "Agent Accept/Length-Type User Range.Type"
> 
> 
> 
```
f /@ tests
```
> 
> {"Agent Accept/Length-Type User Range.Type",  
> 
> "Type&Agent/Cc/Content Length#Accept/Agent.Range-Cc/Content/Code",
> "Cc/Responce.Length#Type-With&User/Begin&User.Agent&Begin/Accept/Cc",
> "Length#User.Type/Begin&Length Type/Accept#Range/Code&And-Accept/Content", "Content/Accept",  
> 
> "Begin/With.Type&Content",  
> 
> "Code.Cc#User.Length-User-And&Type Type&Length.Type User.User&With",  
> 
> "Range&Content With Content-Type Type",  
> 
> "Begin Code#User#Agent.User",  
> 
> "Type Length"}
> 
> 
> 
[Answer]
**PHP : 78 73 65 64 characters**
```
$b=ucfirst;foreach(str_split($s)as$c)echo$b($c),!$b[0]=$c<A?u:l;
```
Input is passed in `$s`. It operates on the string as an array of characters.
It is a simple 2 state machine. It relies on lexical ordering of strings, and that the parser automatically assumes you meant to type a string in some cases.
The state is being stored in `$b` and is being represented as the name of the function that needs to be called on the next character. `ucfirst` and `lcfirst` are shorter to type and have identical behaviour to `strtolower`/`strtoupper` on single character strings. Also, since they only differ by one letter, we can use them efficiently to store the state. The original version needed to store the state explicitly in a boolean.
Since echo doesn't print anything for boolean false, I used a comma and the `!` operator to "hide" the assignment(which in this case is truthy) in the echo statement. This allowed me to save a character by removing the `{}`.
[Answer]
## C, 83
```
n;main(c){c=getchar();putchar(c>96?n?c:(n=c-32):c&64?n?c+32:(n=c):(n=0,c));main();}
```
Takes lines on `stdin`, translates them to `stdout`. (Prefers `SIGINT` to `EOF`.)
[Answer]
# Powershell: 37 - 43
Depending on how you want to take the input...
**Prompt the user for input: 43**
```
(Culture).TextInfo.ToTitleCase((read-host))
```
**Take input from pipeline: 38**
```
(Culture).TextInfo.ToTitleCase($input)
```
**Provide input as an argument when running the script: 37**
```
(Culture).TextInfo.ToTitleCase($args)
```
---
**NOTE:** The above scripts will ignore all-caps words, leaving them as-is. If this needs to be accounted for, the input should be forced to lower-case before the Title Case conversion. This adds 10 characters to the first method, and 12 to the other two.
```
(Culture).TextInfo.ToTitleCase((read-host).ToLower())
(Culture).TextInfo.ToTitleCase("$input".ToLower())
(Culture).TextInfo.ToTitleCase("$args".ToLower())
```
[Answer]
## Java - 209 characters
```
class C{
public static void main(String[]a){
for(String b:a){
char[]k=b.toLowerCase().toCharArray();
for(int i=-1;i<k.length;i++){if(i<0||"-. /&#".indexOf(k[i])>=0)k[++i]=(char)(k[i]-32);}
System.out.println(k);}}}
```
I added newlines only for readability.
[Answer]
### R, ~~143~~ 116
A solution a bit long maybe but here we go:
```
f=function(x){a=sapply(1:nchar(x),function(y)substr(tolower(x),y,y));d=c(1,which(!a%in%letters)+1);a[d]=toupper(a[d]);cat(a,sep="")}
```
Slightly ungolfed and explained:
```
f <- function(x){
    #Split the string in characters and "lower-case" everything
    a <- sapply(1:nchar(x),function(y)substr(tolower(x),y,y))
    #Select the first character and each character following a 
    #character that doesn't belong to lower case alphabet
    d <- c(1,which(!a%in%letters)+1)
    #Make those ones uppercase.
    a[d] <- toupper(a[d])
    #Output (stdout) while pasting them back together.
    cat(a,sep="")
    }
```
**Edit**: 116 characters
The main challenge here is to vectorize `substr`. Here's another less verbose way.
```
f=function(x){n=1:nchar(x);a=mapply(substr,tolower(x),n,n);d=c(T,!a%in%letters);a[d]=toupper(a[d]);cat(a[n],sep="")}
```
Indented:
```
f <- function(x){
    n <- 1:nchar(x)
    a <- mapply(substr,tolower(x),n,n)
    d <- c(T,!a%in%letters) #This has been simplified as well
    a[d] <- toupper(a[d])
    cat(a[n],sep="") #Because a is now 1 char longer than x, need to subset a
    }
```
Usage:
```
> f("aGeNT ACcEpT/LEngTh-tYPe USeR raNgE.TyPe")
Agent Accept/Length-Type User Range.Type
```
[Answer]
# Befunge 98 - ~~24~~ 45
```
~\j:'``!3*j' -;:'``b*j:'/`!3*j' +#;:,'/`!jc#@
```
Writing this hurt my brain. 
This takes input through `~` and if the previous character was one of the separators (or if there was no previous character), it executes 
```
:'``!3*j' -;
```
This snippet takes the character, and if its ascii value is greater than or equal to `a`, it subtracts 32 from it, thus changing it to upper case. If it is less than `a`, `3*j` skips the adjustment. Afterwards, it skips the next part. This part handles changing from upper case to lower case (I'm sure it can be merged with the next part; I'm just not sure how):
```
:'``b*j:'/`!3*j' +#;
```
The character is printed (`,`), then this checks if the character is one of the boundaries:
```
'/`!
```
It basically compares the character to the ascii value of `/`. If the character is not a boundary, the code pushes `12` so that it will skip the capitalization adjustment the next time around. `#` skips over the end program: `@`, and if the end of the input is reached, `~` sends the code execution back to the `@`, ending the program.
[Answer]
# Ruby: ~~60~~ ~~51~~ ~~50~~ 47 characters
```
$_.downcase.chars{|c|$><<$/=$/<?0?c.upcase: c}
```
Sample run:
```
bash-4.1$ for line in "${test[@]}"; do printf '%-75s | %s\n' "$line" "$( ruby -ne '$_.downcase.chars{|c|$><<$/=$/<?0?c.upcase: c}' <<< "$line" )"; done
aGeNT ACcEpT/LEngTh-tYPe USeR raNgE.TyPe                                    | Agent Accept/Length-Type User Range.Type
type&AgeNt/CC/COnteNt lEnGth#acCePT/AgeNt.RAnGe-Cc/contEnt/cODe             | Type&Agent/Cc/Content Length#Accept/Agent.Range-Cc/Content/Code
cc/rEspoNCe.lEngtH#tYpE-witH&UsEr/bEgIN&uSer.AGEnT&begIn/aCCEPt/Cc          | Cc/Responce.Length#Type-With&User/Begin&User.Agent&Begin/Accept/Cc
lENgTH#USeR.tYpE/BeGiN&LENGth tYpe/ACCEpt#rANge/codE&AnD-ACCepT/ConTenT     | Length#User.Type/Begin&Length Type/Accept#Range/Code&And-Accept/Content
contENT/ACcEpT                                                              | Content/Accept
BeGin/wITH.tyPE&conTeNt                                                     | Begin/With.Type&Content
Code.cc#User.lenGTh-USer-AND&tyPE TypE&leNgtH.tYPe usER.UseR&with           | Code.Cc#User.Length-User-And&Type Type&Length.Type User.User&With
RaNgE&COnTeNT WITh CoNTENT-TypE tyPe                                        | Range&Content With Content-Type Type
BEgin COdE#uSeR#aGeNt.USeR                                                  | Begin Code#User#Agent.User
TypE LENGth                                                                 | Type Length
```
[Answer]
# JavaScript (string->string), 67 bytes
```
s=>[...s].map(a=>l=a[`to${'A'>l?'Upp':'Low'}erCase`](),l='').join``
```
Try it:
```
f=s=>[...s].map(a=>l=a[`to${'A'>l?'Upp':'Low'}erCase`](),l='').join``
console.log(f('aGeNT aCcEpT/LEngTh-tYPe USeR raNgE.TyPe'));
console.log(f('type&AgeNt/CC/COnteNt lEnGth#acCePT/AgeNt.RAnGe-Cc/contEnt/cODe'));
console.log(f('cc/rEspoNCe.lEngtH#tYpE-witH&UsEr/bEgIN&uSer.AGEnT&begIn/aCCEPt/Cc'));
console.log(f('lENgTH#USeR.tYpE/BeGiN&LENGth tYpe/ACCEpt#rANge/codE&AnD-ACCepT/ConTenT'));
console.log(f('contENT/ACcEpT'));
console.log(f('BeGin/wITH.tyPE&conTeNt'));
console.log(f('Code.cc#User.lenGTh-USer-AND&tyPE TypE&leNgtH.tYPe usER.UseR&with'));
console.log(f('RaNgE&COnTeNT WITh CoNTENT-TypE tyPe'));
console.log(f('BEgin COdE#uSeR#aGeNt.USeR'));
console.log(f('TypE LENGth'));
```
# [Jacob](https://codegolf.stackexchange.com/users/108687/jacob)'s variant - JavaScript (char[]->char[]), 55 bytes
```
s=>s.map(a=>l=a[`to${'A'>l?'Upp':'Low'}erCase`](),l='')
```
Try it:
```
f=s=>s.map(a=>l=a[`to${'A'>l?'Upp':'Low'}erCase`](),l='')
g = s => f([...s]).join``
console.log(g('aGeNT aCcEpT/LEngTh-tYPe USeR raNgE.TyPe'));
console.log(g('type&AgeNt/CC/COnteNt lEnGth#acCePT/AgeNt.RAnGe-Cc/contEnt/cODe'));
console.log(g('cc/rEspoNCe.lEngtH#tYpE-witH&UsEr/bEgIN&uSer.AGEnT&begIn/aCCEPt/Cc'));
console.log(g('lENgTH#USeR.tYpE/BeGiN&LENGth tYpe/ACCEpt#rANge/codE&AnD-ACCepT/ConTenT'));
console.log(g('contENT/ACcEpT'));
console.log(g('BeGin/wITH.tyPE&conTeNt'));
console.log(g('Code.cc#User.lenGTh-USer-AND&tyPE TypE&leNgtH.tYPe usER.UseR&with'));
console.log(g('RaNgE&COnTeNT WITh CoNTENT-TypE tyPe'));
console.log(g('BEgin COdE#uSeR#aGeNt.USeR'));
console.log(g('TypE LENGth'));
```
[Answer]
## C# ‚Äì 110
A simple finite-state-machine-based processing:
```
x.Aggregate(new{b=1>0,r=""},(s,c)=>new{b="-. /&#".Contains(c),r=s.r+(s.b?Char.ToUpper(c):Char.ToLower(c))}).r
```
(where `x` is the `string` to capitalize)
and of course, if you want to be boring (after the specification was updated), you can use
```
new CultureInfo(9).TextInfo.ToTitleCase(x)
```
or, with all the boring boilerplate:
```
class C{static void Main(string[]a){System.Console.WriteLine(new System.Globalization.CultureInfo(9).TextInfo.ToTitleCase(a[0]));}}
```
[Answer]
## Javascript 102
```
prompt().split(o=q='').map(function(c){o+=(q)?c.toLowerCase():c.toUpperCase(),q=('A'>c)?0:1})
alert(o)
```
[Answer]
## Forth, 135
```
: s swap ;
: c 1 begin key dup 96 > if s if 32 - then 0 s 
else dup 64 > if s 0= if 32 + then 0 s then else 1 s then then emit again ; c
```
Translated output is written to `stdout` as it reads from `stdin`.
[Answer]
## Befunge-98 (29), C (65)
Since the method/algorithm is pretty much the same, I include both versions in the same post. Both rely on keeping track of whether the last character was a symbol or letter, in order to know whether to lowercase a letter or not.
**Befunge-98 (29)**
```
#@~:'0` #v_,0>
',++@'% '<   ^
```
**C (65)**
```
c,d;main(){for(;~(c=getchar());d=c>48)putchar(c<48?c:c&95|32*d);}
```
[Answer]
# [Python 3](https://docs.python.org/3/), 122 bytes
```
lambda s:''.join(chr(ord(c)+[[0,0],[0,32],[-32,0]][('@'<c<'[')-('`'<c<'{')]['@'<p<'['or'`'<p<'{'])for c,p in zip(s,'-'+s))
```
[Try it online!](https://tio.run/##XVFRa9swGHzfrxA1yDaNpdK8jQ7mKsIJFMW4CqN4gTmyYntkspBVSrofn33KoOC@2NLpu@O@O3v2/WiWl@O3n5dT8@fQNmj6Gsfk9ziYRPUuGV2bqPS2ru8Wd/sFfJf38MuW93Dd10n8PX5QD3Edp1kS/7qe/8bpvg64DfjoAmwDvE@Po0NqYdFg0Ptgk2kRZ/HtlKYX6wbjk2Ny0xRaSJQzxa2kT9x0ss/8S6nR7llXyDWi40SeS32Tpl8@SP5sNc47LTxljLKt8XBEJ24K30eNYrqU9PpMqtwUOmOKqtF4bjxV29VcSynq@GRHwTQBhc6vI/9iefY2@DXeTdzRA@82Ar8@a0fyghuJD7rbGNowxkswoGZyJy46uY6CexJ06KMuBoGfuABvCBBNcyBaH7lcdBp8tRznZpUBqiECNhqpjZxbDN4FrHRNafYU1A1928g18eeSYxXows9m2NhqolS0m2CDkzYFRAz@XJaLFQ4sJM@W45MWsDy5hv868YrAfIUhhn6mVoVKMGQuQ3E/NrJHbBQS/GVBBvnPZT3yDupn25ZHkGEVhcY9CQHNxq7k/zEBfvkH "Python 3 ‚Äì Try It Online")
Not a great score, but I wanted to try it without builtin string operations for case changing.
[Answer]
## [AWK](https://www.gnu.org/software/gawk/manual/gawk.html), ~~113~~ ~~103~~ 98 bytes
```
{OFS=""
for(n=split($0,a,"");i<=n;s=a[++i]){$i=(L?tolower(s):toupper(s))
L=!(index("-. /&#",s))}}1
```
[Try it online!](https://tio.run/##JZFRa9swFIXf9StUuwiHxlL7us4MV9GcQFCMozDK2IOr3DlmRja2QhZKf3t65b6Jq3N1zndUX/7dbu@7n/ssisjffkxcNg1d65P7x2W9jKLFc/s9c89TVv9@eGj/LN7v2yzZ/vB9119gTKbFN9@fh2E@Lsg2u0tad4T/SZRyKlgcLXH88fF0u9UFaENzadVgxFa5xpxS/1oCPeyhomOtG8XNtQTirwOwvAHthZRC7pzHI@2UK/wprq2E0oj5mle5KyCVVtjeeeW8sLsVEGvFqKah1xI4bjV@HfvXQaWX1q/ZYVKjeFPNRrPzHkaeF8oZ9gbNxolaSlWiqSWd0o1ZxyEZD7viBYpWs63SmIHiBESO4sHHY64bQP@jYrlbpTgFxJO9M@AMmXNpjDtTk/CKE5eNWXN/LRWzQaY9kf0RuLXxYcJEHbgCq0HvMc31igUlNddBsQ40wvC5tPOkKo76iiHWiVShPoZdmVDyr405Udlrg95pWKU@FPuimtZRuTuqGNmrOPyI5wGSzKIvvE8)
This works fine for single line content, but for multi-line input a few more inits need to be added
## [AWK](https://www.gnu.org/software/gawk/manual/gawk.html), 104 bytes
```
{OFS=i=s=L=""
for(n=split($0,a,"");i<=n;s=a[++i]){$i=(L?tolower(s):toupper(s))
L=!(index("-. /&#",s))}}1
```
[Try it online!](https://tio.run/##JZFRa9swFIXf9Ss0uwiHxtL2us4MV9GcgFGMozDK2IOr3DlmRja2QhZKf3t65b2Jq3N1znfUXP/e72/7H4esy@aszKKI/BmmxGXz2Hc@efi8btZRtHrqvmXuac6aX4@P3e/V20OXJeV3P/TDFaZkXn31w2Ucl@OKlNmnpHMn@JdEKaeCxdEax@/vX@73pgBtaC6tGo0olWvNOfUvFdDjAWo6NbpV3NwqIP42Astb0F5IKeTeeTzSXrnCn@PGSqiMWK55nbsCUmmFHZxXzgu73wCxVkxqHgctgeNW67exfxlVeu38lh1nNYlX1e40uxxg4nmhnGGv0O6caKRUFZpa0ivdmm0ckvGwK56h6DQrlcYMFCcgchSPPp5y3QL6nxTL3SbFKSCeHJwBZ8iSS2PchZqEV5y47syW@1ulmA0y7YkcTsCtjY8zJurBFVgNek9prjcsKKm5jYr1oBGGL6VdZlVz1NcMsc6kDvUx7MqEkn/uzJnKQRv0TsMq9aHYZ9V2jsr9ScXIXsfhRzwPkGQR/cf7AA "AWK ‚Äì Try It Online")
It would have been nice to take advantage of AWK's automatic splitting of a record into fields and modifying said fields, but that throws away the field separators. :(
This update throws away the idea of tacking characters onto a string and then printing the string. Instead, each character becomes its own field. Without the `OFS=""` bit, each character/field would be separated by a space when printed, which isn't what was requested.
Realizing that "" is essentially the same thing as 0 in AWK shortens the byte-count for the multi-line version a little bit. (I know it's different... I said 'essentially' :p )
[Answer]
# QBasic, 74 bytes
```
1c$=LCASE$(INPUT$(1))
IF f=0THEN c$=UCASE$(c$)
f=c$>"@
?c$;
IF""<c$GOTO 1
```
Bytes are counted in [CP-437](https://en.wikipedia.org/wiki/Code_page_437);  is a single byte (character code 20).
The input method here is a bit strange: characters are typed one at a time, and their capitalization is converted before they are displayed. So when you type in `aGeNT`, it appears on screen as `Agent`. Hitting `Enter` ends the program.
[Answer]
# [Python 3](https://docs.python.org/3/), 9 bytes
```
str.title
```
[Try it online!](https://tio.run/##K6gsycjPM/7/v7ikSK8ksyQn9f9/AA "Python 3 ‚Äì Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/) + `-pF`, 42 bytes
```
$\.=~$=?uc:lc,$==index'?/.- &#',$_ for@F}{
```
[Try it online!](https://tio.run/##K0gtyjH9/18lRs@2TsXWvjTZKidZR8XWNjMvJbVC3V5fT1dBTVldRyVeIS2/yMGttvr//0T3VL8QBUfnZNeCEH0f17z0kAzdksiAVIXQ4NQghaJEv3RXvZDKgNR/@QUlmfl5xf91C9wA "Perl 5 ‚Äì Try It Online")
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), ~~20~~ 15 bytes
```
f: Äƒ†‚Ä¢∆õ·∏£v‚á©$‚áßp;f‚àë
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCJmOsqAxKDigKLGm+G4o3bih6kk4oencDtm4oiRIiwiIiwiWW91cmUgYS1uRXJkIl0=)
Or, if that's too long:
## 1 byte
```
«ê
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCLHkCIsIiIsIllvdXJlIGEtbkVyZCJd)
## Explained
```
f: Äƒ†‚Ä¢∆õ·∏£v‚á©$‚áßp;f‚àë
f:               # Push two copies of the letters of the input
   Ä              # is each letter in the first copy in the alphabet?
   ƒ†             # group that on consecutive elements - this has the effect of grouping words.
    ‚Ä¢            # reshape the other copy of the letters to have the same shape as that
     ∆õ           # to each sublist L:
      ·∏£v‚á©        #     push L[0] and [lower(x) for x in L[1:]] - on single length strings this just leaves L[0] on the stack.
         $‚áßp     #     uppercase L[0] and prepend it to the other list
            ;    # close map
             f‚àë  # deep flatten and summate to get a single string - the `d` flag would save 3 bytes here by removing this pair and allowing structure autocompletion to save a byte.      
```
[Answer]
# Excel VBA, 13 characters
In the Immediate window
```
?[Proper(A1)]
```
Function takes input from cell `A1`
## VBScript
```
Set xlapp = CreateObject("excel.application")
wscript.echo xlapp.Evaluate("Proper(""BeGin/wITH.tyPE&conTeNt"")"
```
[Answer]
# [Go](https://go.dev), 153 bytes
```
import."strings"
func f(s string)(o string){c:=0<1
for i:=range s{x:=s[i:i+1]
if c{o+=ToUpper(x);c=!c}else{o+=ToLower(x)}
c=Contains("-. /&#",x)}
return}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=jZJBitswFIahS59CtcE4TC11diVtFq4inMCgGI9CGUoXHkVWTB3JyAqZELLtHUo3odBD9CjtaSo5nUUns-jK4n9Pv7_3P337LvXpZ1fxz5UUYFM1Kmg2nTYWhvXGhj-2tk7f_Pr6qPXWNEr2YVBvFQd10oOzMkr04-nAx5PX766DWhvQjCemUs64PzyMJ_3HZtxcXX8Kmhrwg76aML3sOmGSh9FbPnnJj6LtxVm_0btBPwZ8grWyjqtPwhQCFEfhK68bYbdGHc-Av198GYA8fzICh6BwKLZVSZ2A8L3IG4V2czaDdl-QmGvFBLUhGI3-6atyQRnIMCcdQzdESbZO7V0hwPJWlMBUVBLI9oUIwdObdt-JOJPOFGGM8EJZdwQtUbldRxXHomBoKMMyU7lIMUcOwhJlEV9MnzHkHBnSd5piAZ2NtLPI3nUk3TV2Fi97YtA9kXMab2-FgVlOFIvvhZwrVGFMCkfBLz1bQiWbRX4Y6M2Qz4XGN4Q6SuAUgTJ3u7ORyagUjnBF4kxNU6cKlwj2sSn2DKwfhboJh-Qu6_-bP9YrATmPlr0bqhUqd_k7WpNmdBr7m4DtOxK3gro84LCZbU9K6PrL2CWzvvx16ZcWu4Uwv9oPc7YGWFPmaFPvBeywzqe8RDYK4MWKRC7fMvLvwkKf20XrYHJOcKj9fY6n0_n7Bw)
[Answer]
# [Julia 1.0](http://julialang.org/), 9 bytes
```
titlecase
```
[Try it online!](https://tio.run/##fVHRitswEHy/rxAxiDuoJfoDB66yOIFDMT6Fchx98CmL7OIqxt5wDfTf010H@tg3MTujnZn9eRmH7uvv240GGjF2C95@ddPjUD7/Ax6Hpy/vD2oTzzmgD@UIPlG/YeQb1kO2n/uwM3RtQN8ZJKOuZqqqXIQp2BfIKfQlvTWojq/YqrnzCUy4NrhRTKbrhLpKLLXOWXfIxE81Qq6pL7rosAl2HZu2yjWWLlpeRZDJxsP2/keMdoZlOnuHhpWJdgW9TVB@DrTTxwVm@wFp7/XlFWdT1ZCD/sC0z7ZzDhpeHNdvJFzYFeLSiN5KRq9fwLMXxQjaigUTFXPlE7KPE@gqb0tGkaM6qSCHuyXx6Nn62sIK/acxdz6hibE4LmxwxFxzY2xjLiu/1UJW4TqBHpHbZ7V0eVmgNcxvNafs1wWtNKu5QjmV@r4PvXJnH9hGKXJF0rkYgTRk5Q4nKLiRtpB7kZHYMl2p98ybhx9Pyvx5VtM8ZBrz7S8 "Julia 1.0 ‚Äì Try It Online")
[Answer]
# [Thunno](https://github.com/Thunno/Thunno), \$2\log\_{256}(96)\approx\$ 1.65 bytes
```
zV
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72sJKM0Ly9_wYKlpSVpuhaLqsIgDCh_wXanVPfMPP1yzxAPvZLKAFe15Py8kFS_Eog0AA)
Just a built-in solution.
[Answer]
# JavaScript (Node.js), ~~54~~ 53 bytes
Exact same score as [the RegEx approach](https://tio.run/##NZHhauswDIV/3z1FaMC0sNhP0EHmirRQ3JC5XMY2WOpqbkZmm8S7XZ@@V07ZPyMdSd85/mz/taMZuhAL5494/Vhex@XDyKPf@jMOsh1xvuADhr41OBevBy7s/c/y4YcU@xB@FYur8W70PfLe2/nL3Z9ZW6HSWSkNBC224Kw@FfG5xmz/hE02tMoC15caZ/ckjpeArLSoopBSyJ2L9Mx6cFU85a2RWGsxtXlTugoLaQTdi@CiMLvVbYcxYoAxeCUJgu7FdR6fAxTnLq7ZfoRBHMBuFPt@woGXFTjNDmg3TrRSQk2HzbSmB2X1Ok@UPM2LR6w6xbagiCWjCoqSBkLMh1JZJI4jsNKtCqoiWZXeaXT6hpQYFaFPKUyltM2J80avebzUwEySqzj1JH0ANybfj0TYo6soMuIYilKtWFJn@hKA9ajIHJ/C/B6h4aRvGNk8TVuaFC2jDHX6gL8bfcqkV5o4ijSexd/QH8F2LpO7I@SUSZOnH4s8GZ/ak/hme3b3xr/aMP9Y8E/fufdX9764/gc) would have been!
```
s=>Buffer(s.toLowerCase()).map(x=c=>x=x>64?c:c^32)+``
```
[Try it online!](https://tio.run/##NZHditswEIWvu09hYhAxXUuwLb0oOIujCCcQFONVKEt/iFeZOF68krGVJnn6dKTQOzE6M/OdM@/133rUQ9u71Ng93A7Zbcxm89PhAMN0pM6u7RkGXo8wTRL6UffTS6az2SW7zL59fdbf9Z8vT8nn3e6mrRltB7SzzfTnw6dJXYBUUc616BVbC9OoY@peS4i2L1BFQy0bQdW1hMkjit21B5I3IB3jnPGNcfiMOmEKd4xrzaFULHzTKjcFpFwz3OeEcUxvFvcZWrNBjL2VHCFwn1vG7rUX6bl1S7IdxcDeRLOS5PQCA80LYRR5g2ZlWM25KHGxDmM6IRu1jD0l9f1sDkUryVpIZImwAizHht7FQy4bQI69ILlZpFgFtMqtUWDUHckzSkQPKYSSn2bYeaWW1F1LQbSXSxf@OB6Aah1vRyTswBQYGXIMaS4XxKsjde0F6UCiORrCPI2ioqivCNo8himVj5Zghsof4MdKHSNupUKO1LdH7n/oc9G0JuKbvYgxkyr2F3PUGw/fQXy3PXn4HU5/SOi7bc3ul9klt38) (includes all test cases)
[Answer]
# [K (ngn/k)](https://codeberg.org/ngn/k), 36 bytes
```
{,/{`c$x-32*~!#x}'_(&1,~~"a{"'_x)_x}
```
[Try it online!](https://ngn.codeberg.page/k#eJytU1FP2zAQfu+v8BpkYCK22DShtU9ZsNpKKFTBCCGEILhuEtE5WWJEuor+9t05ho0HJKTxFOfu/H3f3X1ejjYHfHOrdrrw65fP209B97R7s0cPD7bbYbYZ7t50+zfd02BgR5udq/W2GS0JId34trof790us3I17sbrcbN//TSwV8NsohNJoliJWvITYXJZhPZyrsn5mU5JkyW5YHI918PxMMq1sSRSSteWn2iT2yKU6xpKW92QNDO5Zvg/vEZgCycKVxLL45jHp8bCkayEmdgiyFSs55K7NEsjM9FhrLiqjBXGcnV6jHzSI0AEkjEkkb8nDrwMl2aOO/xbBN+Fl6EUb0RbV0msGZDndhrYy1qEj6Wd0vNWNPxO5LOEPpzphkUTYSS90/nM8CyOxRyZQQkgpxpAjNLM86O48KK0BcXu+Q+dl8YdmZNEXYB7lQDixKxEkstpgKNlqAKuTcqEnogEhkIgonkEtLUNmijJNQxkIWhkjkOIatgPtCe1kaDIq3CEKMUL6MPERXruwM3GDQSQFuGzon5QfkY49wTW4VyA/fox9sV9EUo1/HEmp8yu54Iq1JJYqO5bxVk4KfQVNhIzpXqlK20m4C/ovwmj5JgiEIoVdKUTWA1zzntoRcqgPqWwpMLJAYzYY3jj4TmEhqhzoOPtM+zFkojRUNTVS0nRzBScKNHyFzNZkLhKJHSONhbE9jZ3A3tuguB14n/CFy4/EgGNk/h0IQKwTxrgW7IMt/s8FYLSne6gdyoe+8uOst+897q3NqQHfFBYW7cjjhbQebVastZm6l53qnDvTFU/+a8H3dqyMi0//Pb96IirrC5ttip/67C1TWnyAXn/8yZQ/L9PFjE+4L0hzEe9FCfptb0x9JaZIfX/hkWCd3kNhbxtIcj+65HBH29m7oE=)
* `_(&1,~~"a{"'_x)_x` split input after each non-letter and lowecase it, e.g. `"Begin/With.Type&Content"` to `("begin/";"with.";"type&";"content")`
* `{`c$x-32*~!#x}'` subtract 32 from the first character in each word and 0 from the rest (in effect capitalizing the first letter and leaving the others unchanged)
* `,/` flatten back into a single string and (implicitly) return
[Answer]
## T-SQL, 179
```
DECLARE @T VARCHAR(MAX)='foo',@X VARCHAR(2),@ INT=0WHILE @<LEN(@T)SELECT @X=SUBSTRING(@T,@,2),@+=1,@T=STUFF(@T,@,1,IIF(@X LIKE'[a-Z]_',LOWER(RIGHT(@X,1)),UPPER(RIGHT(@X,1))))PRINT @T
```
Try the SELECT version in SQL Server 2012 [here](http://sqlfiddle.com/#!6/d41d8/21970).
Replace "foo" with the input string. The char count is for a zero-length string. This code traverses the string using an index, uppercasing or lowercasing the character at that position based on the previous character.
]