Skip to content

Commit

Permalink
fixed one syllable
Browse files Browse the repository at this point in the history
  • Loading branch information
dfinke committed Sep 10, 2020
1 parent 32886d0 commit 6ac4833
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"powershell.codeFormatting.addWhitespaceAroundPipe": true
}
9 changes: 7 additions & 2 deletions 15_kentucky_friar/friar.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ function Invoke-Fry {
}

if ($word.EndsWith('ing')) {
$word.Substring(0, ($word.Length - 1)) + "'"
}
if ($word.Substring(0, ($word.Length - 3)).IndexOfAny('AaEeIiOoUuYy'.ToCharArray()) -gt -1) {
$word.Substring(0, ($word.Length - 1)) + "'"
}
else {
$word
}
}
}

if (Test-Path $text -ErrorAction SilentlyContinue) {
Expand Down
9 changes: 7 additions & 2 deletions 15_kentucky_friar/solution1.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ function Invoke-Fry {
}

if ($word.EndsWith('ing')) {
$word.Substring(0, ($word.Length - 1)) + "'"
}
if ($word.Substring(0, ($word.Length - 3)).IndexOfAny('AaEeIiOoUuYy'.ToCharArray()) -gt -1) {
$word.Substring(0, ($word.Length - 1)) + "'"
}
else {
$word
}
}
}

if (Test-Path $text -ErrorAction SilentlyContinue) {
Expand Down
Binary file modified 15_kentucky_friar/test.ps1
Binary file not shown.

0 comments on commit 6ac4833

Please sign in to comment.