wes d2a2ba9e15 first commit 4 年 前
..
README.md d2a2ba9e15 first commit 4 年 前
code.cpp d2a2ba9e15 first commit 4 年 前
unitTest.cpp d2a2ba9e15 first commit 4 年 前

README.md

Get the File Extension

by Helen Yu tags: strings, higher_order_functions, arrays

Summary

Write a function that maps files to their extension names. Examples getExtension(["code.html", "code.css"]) ➞ ["html", "css"] getExtension(["project1.jpg", "project1.pdf", "project1.mp3"]) ➞ ["jpg", "pdf", "mp3"] getExtension(["ruby.rb", "cplusplus.cpp", "python.py", "javascript.js"]) ➞ ["rb", "cpp", "py", "js"] Notes N/A

Instructions

Write a function that maps files to their extension names.

Examples

getExtension(["code.html", "code.css"])
➞ ["html", "css"]

getExtension(["project1.jpg", "project1.pdf", "project1.mp3"])
➞ ["jpg", "pdf", "mp3"]

getExtension(["ruby.rb", "cplusplus.cpp", "python.py", "javascript.js"])
➞ ["rb", "cpp", "py", "js"]

Notes

N/A