FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Abridged (A-Z) \ Complete (A-Z)  
   
  Reference for Processing (BETA) version 91+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.  
Name  

splice()

   
Examples  
String sa1[] = { "OH ", "NY ", "CA "}; 
sa1 = splice(sa1, "KY ", 1); 
print(sa1);  // Prints "OH KY NY CA " 
println(); 
String sa2[] = { "VA ", "CO ", "IL "  }; 
sa1 = splice(sa1, sa2, 2); 
print(sa1);  // Prints "OH KY VA CO IL NY CA " 

Description   Inserts a value or array of values into an existing array. The first two parameters must be of the same datatype. The array parameter defines the array which will be modified and the second parameter defines the data which will be inserted.
   
Syntax  
splice(array, value, index)
splice(array, array2, index)
   
Parameters  
array   booleans[], bytes[], chars[], ints[], floats[], or Strings[]: base array

value   booleans, bytes, chars, ints, floats, or Strings: value to be spliced in

array2   booleans[], bytes[], chars[], ints[], floats[], Strings[]: array to be spliced in

index   int: position in the array from which to insert data

   
Returns   Array (the same datatype as the input)
   
Usage   Web & Application
   
Related   contract()
subset()
 
 






   
 
Updated: Fri Jul 15 16:36:10 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info