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

battle programming a forum for elite programmers with extreme will power to sharpen their skills

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)

_________________
MB over and out emp it up

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)
⭐

_________________
kurayami no kagi admin

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)

_________________
kurayami no kagi admin
privacy_tip Permissions in this forum:
You cannot reply to topics in this forum