Learn R Programming

beautier (version 2.6.12)

count_trailing_spaces: Count the number of spaces before the first character

Description

Count the number of spaces before the first character

Usage

count_trailing_spaces(line)

Value

the number of spaces before the first character

Arguments

line

line of text

Author

Richèl J.C. Bilderbeek

Examples

Run this code
check_empty_beautier_folder()

# 0
count_trailing_spaces("x")
# 1
count_trailing_spaces(" y")
# 2
count_trailing_spaces("  <")
# 0
count_trailing_spaces("")
# 1
count_trailing_spaces(" ")
# 2
count_trailing_spaces("  ")

check_empty_beautier_folder()

Run the code above in your browser using DataLab