Adds the string to the Octave script. At the end of the line a semicolon is appended. If the string contains two consecutive dollar signs (i.e. `$$`) these will be replaced by a vector containing the elements of `vals`. # Example ``` # extern crate rustml; use rustml::octave::*; # pub fn main() { let s = builder().add_vector("x = $$", &[1, 2, 3]); assert_eq!( s.to_string(), "1;\nx = [1,2,3];\n
(&self, s: &str, vals: &[T])
| 108 | /// # } |
| 109 | /// ``` |
| 110 | pub fn add_vector<T: fmt::Display>(&self, s: &str, vals: &[T]) -> OctaveScriptBuilder { |
| 111 | |
| 112 | let mut t = s.to_string(); |
| 113 | let v = self.to_vec(vals); |
| 114 | t = t.replace("$$", &v); |
| 115 | self.add(&t) |
| 116 | } |
| 117 | |
| 118 | /// Adds the string to the Octave script. |
| 119 | /// |
no test coverage detected