Learn R Programming

pasta (version 0.1.0)

pasta: Make pasta with Strings

Description

Pasta provides a set of easy to read infix function for the intuitive pasting of characters. Currently the following functions are available for concatenation:

%_% pastes two strings by "_".

%-% pastes two strings by "-".

%.% pastes two strings by ".".

%//% pastes two strings by "/".

%&% pastes two strings by "".

%&&% pastes two strings by " ".

%|% pastes two strings with a "|".

Usage

a %_% b
a %-% b
a %.% b
a %//% b
a %&% b
a %&&% b
a %|% b

Arguments

a, b
characters.

Examples

Run this code
'macaroni' %_% 'sauce' # 'macaroni_sauce'
'ravioli' %-% 'recipe' # 'ravioli-recipe'
'spaghetti' %.% 'code' # 'spaghetti.code'
'fusilli' %//% 'farfalle' # 'fusilli/farfalle'
'pasta' %&% 'sciutta' # 'pastasciutta'
'noodle' %&&% 'soup' # 'noodle soup'
'carbonara' %|% 'ragù' # 'carbonara|ragù'
'spaghetti' %&&% 'al' %-% 'dente' # 'spaghetti al-dente'

Run the code above in your browser using DataLab