Learn R Programming

fritools (version 4.6.0)

file_string: Substitute All Blanks and Punctuations in a String with an Underscore

Description

Need to store stuff on disk. Replacement may also be a minus sign instead of underscore.

Usage

file_string(x, replacement = c("_", "-"))

Value

A string.

Arguments

x

A string.

replacement

The replacement character.

See Also

Other file utilities: clipboard_path(), delete_trailing_blank_lines(), delete_trailing_whitespace(), develop_test(), file_copy(), file_modified_last(), file_save(), find_files(), get_lines_between_tags(), get_mtime(), get_unique_string(), grep_file(), is_files_current(), is_path(), paths, runsed(), search_files(), split_code_file(), touch()

Other vector functions: char2factor(), escape_non_ascii(), powers_of_ten

Examples

Run this code
file_string("foo:bar$ this, indeed(!) is # a number 7")
file_string("foo:bar$ this, indeed(!) is # a number 7", replacement = "-")

Run the code above in your browser using DataLab