From 64057cc6d74eeb9cf8d118f1af6cf4858a1271fa Mon Sep 17 00:00:00 2001 From: zainabdnaya Date: Fri, 13 Oct 2023 16:20:43 -0400 Subject: [PATCH] docs(asterisksfirst): Adding the subject of exercice asterisksfirst for js piscine --- subjects/asterisksfirst/README.md | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 subjects/asterisksfirst/README.md diff --git a/subjects/asterisksfirst/README.md b/subjects/asterisksfirst/README.md new file mode 100644 index 000000000..e8ba4ee04 --- /dev/null +++ b/subjects/asterisksfirst/README.md @@ -0,0 +1,36 @@ +## asterisksfirst + +### Instructions + +Create function that processes a string. + +It should trim spaces from the beginning and end of the string and capitalize the first letter of each word. + +Furthermore, it should remove spaces between words and prepend the string with an asterisk (*). + +The function should return the processed string, but if the resulting string exceeds 250 characters in length, or if the input or output is empty, it should return 'false'. + +### Expected function + +```js +function asterisksfirst(inputString) { +} +``` + +### Usage + +Here is a possible program to test your function: + +```js +const inputString = " this is a test string "; +const format = asterisksfirst(inputString); +console.log(format); +``` + +and the output should be: + +```console +$ node index.js +"*ThisIsATestString" +$ +``` \ No newline at end of file