public static Path write(Path path,String string,Charset cs,OpenOption... options) throws IOException {
  try (Writer w=Files.newBufferedWriter(path,cs,options)){
    w.write(string);
  }
   return path;
}

public static Path write ( Path path , String string , Charset cs , OpenOption ... options ) throws IOException { try ( Writer w = Files . newBufferedWriter ( path , cs , options ) ) { w . write ( string ) ; } return path ; }
writes a string to a file .
