Skip to contents

This function takes a string as input and replaces all spaces with underscores. It is useful for formatting strings to be used in contexts where spaces are not allowed or desired.

Usage

ReplaceSpace(x)

Arguments

x

A character string. The string in which spaces will be replaced with underscores.

Value

A character string with all spaces replaced by underscores.

Author

Ahmed El-Gabbas

Examples

ReplaceSpace("Genus species")
#> [1] "Genus_species"

ReplaceSpace("Genus species subspecies")
#> [1] "Genus_species_subspecies"