Skip to contents

Takes a substituent string (potentially with multiple substituents) and returns a normalized string with substituents sorted by position.

Usage

normalize_substituents(sub)

Arguments

sub

A character string representing substituents, e.g., "4Ac,3Me" or "6S"

Value

A character string with substituents sorted by position, e.g., "3Me,4Ac"

Examples

normalize_substituents("4Ac,3Me")  # Returns "3Me,4Ac"
#> [1] "3Me,4Ac"
normalize_substituents("6S")       # Returns "6S"
#> [1] "6S"
normalize_substituents("")         # Returns ""
#> [1] ""