A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Welcome to the Capitalize page! Here, you'll find a description of the project as well as a list of sample programs written in various languages.
This article was written by:
This simple program picks a string and return the first letter of it in uppercase.
For this sample program, each solution should return the string with the first letter in uppercase. For example, the following code should return "Capitalize":
$ ./capitalize.lang "capitalize"
Capitalize
Here are some additional examples:
string -> String
react -> React
java -> Java
car -> Car
a long string term -> A long string term
In addition, there should be some error handling for situations where the user doesn't input a string.
Every project in the Sample Programs repo should be tested. In this section, we specify the set of tests specific to Capitalize. In order to keep things simple, we split up the testing as follows:
Description | Input | Output |
---|---|---|
Sample Input: Lowercase String | "hello" | "Hello" |
Sample Input: Uppercase String | "Hello" | "Hello" |
Sample Input: Long String | "hello world" | "Hello world" |
Sample Input: Mixed Casing | "heLLo World" | "HeLLo World" |
Sample Input: Symbols | "12345" | "12345" |
Description | Input |
---|---|
No Input | |
Empty Input | "" |
All of these tests should output the following:
Usage: please provide a string
There are 34 articles: