Title: | A Few Esoteric String Operations |
---|---|
Description: | A few esoteric string operations in R. |
Authors: | Matthew Henderson [aut, cre] |
Maintainer: | Matthew Henderson <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.0 |
Built: | 2024-11-07 05:42:45 UTC |
Source: | https://github.com/MHenderson/llinyn |
This function reads and parses timestamps from text and then outputs a differently formatted string representing the same timestamp.
extract_time_label(text)
extract_time_label(text)
text |
Input text. |
A formatted timestamp string.
Chop a String of Text to a Specific Width
gqg(x, textwidth)
gqg(x, textwidth)
x |
A string. |
textwidth |
Desired width of output strings. |
A string with more newline characters.
Chop a String of Text to a Specific Width
gqg_paragraph(s, textwidth)
gqg_paragraph(s, textwidth)
s |
A string. |
textwidth |
Desired width of output strings. |
A string with more newline characters.
Locate Last Space Before a Space in a String
locate_last_space_before(s, x)
locate_last_space_before(s, x)
s |
A string. |
x |
An index. |
The position of the last space character in s before x.
Replace certain characters in a string with escaped versions of those same characters for the benefit of LaTeX.
repair_latex_string(x)
repair_latex_string(x)
x |
A text string. |
A text string with some escaped characters.
Replace a Character at a Location in a String
replace_at_i(s, i, x = "\n")
replace_at_i(s, i, x = "\n")
s |
A string. |
i |
An index. |
x |
A character. |
The string s but with character x inserted at position i.
Removes all datetime headings like "% Tue 3 Mar 09:20:25 GMT 2020".
strip_time_headings(text)
strip_time_headings(text)
text |
A string of text, possibly containing datetime headings. |
The input string with all datetime headings removed.
This takes a ymd (e.g. 2024/09/01) and returns the same date in text format (e.g. Sunday 1 September 2024).
ymd_text_format(ymd)
ymd_text_format(ymd)
ymd |
A date in ymd format. |
A date string.