pub fn join(value: Value, args: HashMap<String, Value>) -> Result<Value> {
    let arr = try_get_value!("join", "value", Vec<Value>, value);
    let sep = match args.get("sep") {
        Some(val) => try_get_value!("truncate", "sep", String, val),
        None => String::new(),
    };

    // Convert all the values to strings before we join them together.
    let rendered = arr.iter().map(|val| val.render()).collect::<Vec<_>>();
    Ok(to_value(&rendered.join(&sep))?)
}
/// Joins all values in the array by the `sep` argument given
/// If no separator is given, it will use `""` (empty string) as separator
/// If the array is empty, returns empty string
Joins all values in the array by the `sep` argument given
If no separator is given, it will use `""` (empty string) as separator
If the array is empty, returns empty string
Joins all values in the array by the ` sep ` argument given If no separator is given it will use ` " " ` ( empty string ) as separator If the array is empty returns empty string
pub fn join(value: Value, args: HashMap<String, Value>) -> Result<Value> {
    let arr = try_get_value!("join", "value", Vec<Value>, value);
    let sep = match args.get("sep") {
        Some(val) => try_get_value!("truncate", "sep", String, val),
        None => String::new(),
    };
    // Convert all the values to strings before we join them together.
    let rendered = arr.iter().map(|val| val.render()).collect::<Vec<_>>();
    Ok(to_value(&rendered.join(&sep))?)
}
pub fn join ( value : Value , args : HashMap < String , Value > ) -> Result < Value > { let arr = try_get_value ! ( " " " " Vec Value value ) ; let sep = match args . get ( " " ) { Some ( val ) => try_get_value ! ( " " " " String val ) , None => String :: new ( ) , } ; // Convert all the values to strings before we join them together. let rendered = arr . iter ( ) . map ( | val | val . render ( ) ) . collect :: < Vec < _ > > ( ) ; Ok ( to_value ( & rendered . join ( & sep ) ) ? ) }
Joins all values in the array by the `sep` argument given
If no separator is given, it will use `""` (empty string) as separator
If the array is empty, returns empty string
Joins all values in the array by the ` sep ` argument given If no separator is given it will use ` " " ` ( empty string ) as separator If the array is empty returns empty string
value
Value
args
HashMap<String, Value>
value
Value
args
HashMap<String, Value>