fn: vjoin
[contents]

Contents

Syntax

The syntax for vjoin calls is:

f++:  
vjoin{options}(std::vector, string)
vjoin{options}(std::vector, string, begin)
vjoin{options}(std::vector, string, begin, end)

n++:  
@vjoin{options}(std::vector, string)
@vjoin{options}(std::vector, string, begin)
@vjoin{options}(std::vector, string, begin, end)

Description

The vjoin function takes all items in a standard vector (of type double or string) and returns them joined in to one string, it takes 2-4 input parameters, the first parameter should be a standard vector, the second parameter should be a string to separate each item with, the optional third parameter should be a non-negative integer to specify which position to begin at and the optional fourth parameter should be a non-negative integer to specify which position to end at.

Options

The following options are available for join calls:

option description
<- add separator at beginning
-> add separator at end
<-> add separator at both beginning and end
!round do not round values of type double
option description

f++ example

Examples of vjoin being used with f++:

std::vector<string> v
v.push_back("cat")
v.push_back("dog")

console('{vjoin(v, ", ")}')

n++ example

Example of vjoin being used with n++:

@std::vector<string>(v)
@v.push_back("cat")
@v.push_back("dog")

@console('{vjoin(v, ", ")}')

Sponsors