battle programmers alliance
Would you like to react to this message? Create an account in a few clicks or log in to continue.

battle programmers allianceLog in

the LivinGrimoire Artificial General Intelligence software design pattern forum

descriptionvb.net megazord string outputter Emptyvb.net megazord string outputter

more_horiz
I don't know what its called but it is useful

Code:

 Console.WriteLine("Converted the {0} value '{1}' to the {2} value {3}.", str1, str2, str3, strx)

descriptionvb.net megazord string outputter Empty2nd example

more_horiz

Code:

Dim miscInfo As String = [String].Format("Your dog has {0} fleas. " + "It is time to get a flea collar. " + "The current universal date is: {1:u}.", numberOfFleas, DateTime.Now)


and another example :

Code:

Dim miscInfo As String = [String].Format("test{0} and {1}", 2 + 4, 5 * 8)
⭐

descriptionvb.net megazord string outputter Emptyjava eclipse oxyzen string megazord

more_horiz

Code:


package PL;

import java.util.Scanner;
import static java.lang.System.out;

public class test2 {

   public static void main(String[] args) {
      // TODO Auto-generated method stub
      String s1 = String.format("hi %s %s welcome %d", "king","moti",5);
            System.out.println(s1);
      
   }
}

prints :
hi king moti welcome 5

see string format java list for more data types (%s %d)
privacy_tip Permissions in this forum:
You cannot reply to topics in this forum
power_settings_newLogin to reply