Learn R Programming

RandomWalker (version 0.1.0)

convert_snake_to_title_case: Helper function to convert a snake_case string to Title Case

Description

Converts a snake_case string to Title Case.

Usage

convert_snake_to_title_case(string)

Value

A character string converted to Title Case.

Arguments

string

A character string in snake_case format.

Author

Antti Lennart Rask

Details

This function is useful for formatting strings in a more readable way, especially when dealing with variable names or identifiers that use snake_case. This function takes a snake_case string and converts it to Title Case. It replaces underscores with spaces, capitalizes the first letter of each word, and replaces the substring "cum" with "cumulative" for better readability.

See Also

Other Utility Functions: generate_caption(), rand_walk_helper()

Examples

Run this code
convert_snake_to_title_case("hello_world") # "Hello World"
convert_snake_to_title_case("this_is_a_test") # "This Is A Test"
convert_snake_to_title_case("cumulative_sum") # "Cumulative Sum"

Run the code above in your browser using DataLab