[][src]Function phpify::string::implode

pub fn implode<G>(glue: G, pieces: &Vec<String>) -> String where
    G: AsRef<str>, 

Join vec elements with a string.

Description

Join vec elements with a glue string.

Examples

Example #1 implode() example

use phpify::string::implode;

let vec = vec!["lastname".to_string(), "email".to_string(), "phone".to_string()];
let comma_separated = implode(",", &vec);

assert_eq!(comma_separated, "lastname,email,phone");