-
-
Save pramodya1994/65ec2f91b57ab529f392cb5d366953bc to your computer and use it in GitHub Desktop.
new main.bal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prints `Hello` with input string name. | |
# | |
# + name - the input sting name | |
# + return - "Hello " with the input string name | |
public function sayHello(string name) returns string { | |
if !(name is "") { | |
// We are adding "!" in the end and remove "," after hello as a bug fix. | |
return "Hello " + name + "!"; | |
} | |
return "Hello, World!"; | |
} | |
# Prints `Bye` with input string name. | |
# | |
# + name - the input sting name | |
# + return - "Bye" with the input string name | |
public function sayBye(string name) returns string { | |
if !(name is "") { | |
return "Bye " + name + "!"; | |
} | |
return "Bye, World!"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment