Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Script is a script that when you pass it a series of words it will respond with

ID: 3539835 • Letter: S

Question

Script is a script that when you pass it a series of words it will respond with words
that are property capitalized as you would find in a title. The script should accept two arguments named
Title and AllCaps. The title argument is where the user will pass a string to be properly capitalized. The
allcaps argument is a switch type argument and if specified the title will be returned in all capital letters
rather than just the first character of each word. Here are some examples
Make-Title %u201Conce upon a time%u201D           Would return Once Upon A Time
Make-Title %u201Conce upon a time%u201D %u2013AllCaps Would return ONCE UPON A TIME
Make-Title %u201CONCE upon a time%u201D    Would return Once Upon A Time

Explanation / Answer

param([string]$Title = "cap the title", [switch]$AllCaps)
    Write-Host $Title. "------ ".$AllCaps;

if($AllCaps) {
    Write-Host $Title.ToUpper();
} else {
Write-Host (Get-Culture).TextInfo.ToTitleCase($Title);
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote