toUnderscoreSeparated: Convert a String to underscore_separated Format

View source: R/Stringendo.R

toUnderscoreSeparatedR Documentation

Convert a String to underscore_separated Format

Description

This function converts a string from camelCase or dot-separated format to an underscore-separated format. It can handle strings that are a combination of camelCase and dot-separated formats. The function replaces dots with underscores and inserts an underscore before any uppercase letter that follows a lowercase letter. It then converts all characters to lowercase.

Usage

toUnderscoreSeparated(input_string, toclipboard = FALSE)

Arguments

input_string

A character string in camelCase, dot-separated format, or a combination of both. There is no default value for this parameter; a string must be provided.

toclipboard

Copy to clipboard? Default: TRUE

Value

A character string converted to underscore_separated format.

Examples

toUnderscoreSeparated("plot.Metadata.cor.heatMap")
toUnderscoreSeparated("plotMetadataCorHeatMap")
toUnderscoreSeparated("plot.metadataCor.heatMap")

vertesy/Stringendo documentation built on Nov. 10, 2024, 4:35 a.m.