diff --git a/Sources/mccCore/MorseCodeConverter.swift b/Sources/mccCore/MorseCodeConverter.swift index efcc49c..b8f380b 100644 --- a/Sources/mccCore/MorseCodeConverter.swift +++ b/Sources/mccCore/MorseCodeConverter.swift @@ -19,7 +19,7 @@ public struct MorseCodeConverter { let textWithoutFancyQuotes = textWithoutFancyDoubleQuotes.replaceSingleQuotes(textWithoutFancyDoubleQuotes, singleQuotesArray: singleQuotesArray) let textWithoutFancyQuotesHyphensAndDashes = textWithoutFancyQuotes.replaceHyphensAndDashes(textWithoutFancyQuotes, hyphensAndDashesArray: hyphensAndDashesArray) - var morseText = "\n" + var morseText = "" let characterArray = textWithoutFancyQuotesHyphensAndDashes.lowercased().map { String($0) } for character in characterArray { @@ -34,7 +34,7 @@ public struct MorseCodeConverter { } } } - return morseText.isEmpty ? textToConvert : morseText + "\n" + return morseText.isEmpty ? textToConvert : morseText } } diff --git a/Sources/mccCore/Program.swift b/Sources/mccCore/Program.swift index 7368315..b05476c 100644 --- a/Sources/mccCore/Program.swift +++ b/Sources/mccCore/Program.swift @@ -15,8 +15,7 @@ public struct Program { if copy { copyToClipboard(textToCopy: conversionResult) } - print("\n\(textToConvert) in morse:") - return conversionResult + return "\n" + textToConvert + " in morse: " + conversionResult + "\n" } func copyToClipboard(textToCopy: String) {