oxfordJoin

Create a single grammatically correct comma separated string from an array of strings
1 téléchargement
Mise à jour 25 nov. 2020

Afficher la licence

Did you ever need to take a variable with a number of strings and create a grammatically correct comma separated string out of it? If so, here's the function for you! The input can be a array of strings or a cell array of chars; the output will be a string with commas, an and, and even an Oxford comma! Some examples:

output = oxfordJoin(["Yesterday","Today"])
output =
"Yesterday and Today"

output = oxfordJoin(["Yesterday","Today","Tomorrow"])
output =
"Yesterday, Today, and Tomorrow"

output = oxfordJoin({'Yesterday','Today','Tomorrow','Next Year'})
output =
"Yesterday, Today, Tomorrow, and Next Year"

Citation pour cette source

Brian Bagenstose (2024). oxfordJoin (https://www.mathworks.com/matlabcentral/fileexchange/83398-oxfordjoin), MATLAB Central File Exchange. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2020b
Compatible avec les versions R2016b et ultérieures
Plateformes compatibles
Windows macOS Linux
Tags Ajouter des tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version
1.0.0