User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







java:io:printstream:format

This is an old revision of the document!


Table of Contents

format

format args to the format string format and write the result to the stream

format(String format, Object... args);
 
return value: stream

Language Example

   String strout = null;
   String str = "is the answer";
   int i = 42;
   String[] args = { "way", "example" };
 
   strout = String.format("%d %s", i, str);
   System.out.println(strout);
 
   strout = String.format( "this is another %s for this %s.", args ); 
   System.out.println(strout);

output

  42 is the answer
  this is another way for this example.
  

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
java/io/printstream/format.1353674793.txt · Last modified: 2024/02/16 01:11 (external edit)

Impressum Datenschutz