JavaScript Intl ListFormat format() Method Last Updated : 24 May, 2023 Comments Improve Suggest changes Like Article Like Report The Intl.ListFormat.prototype.format() method is an inbuilt method in JavaScript that returns a string with a language-specific representation of the list. Syntax: listFormat.format([list]); Parameters: This method accepts a single parameter as mentioned above and described below: list: This parameter holds an iterable object, such as an Array. Return Value: This method returns a language-specific formatted string representing the elements of the list. The below examples illustrate the Intl.ListFormat.prototype.format() method in JavaScript: Example 1: In this example, we will return a string from an array using the Intl.ListFormat.prototype.format() method in JavaScript. javascript <script> const gfg = ['Geeks1', 'Geeks2', 'Geeks3', 'Geeks4']; const result1 = new Intl.ListFormat('en', { style: 'long', type: 'conjunction' }); console.log(result1.format(gfg)); const result2 = new Intl.ListFormat('db', { style: 'short', type: 'disjunction' }); console.log(result2.format(gfg)); const result3 = new Intl.ListFormat('en', { style: 'narrow', type: 'unit' }); console.log(result3.format(gfg)); </script> Output: "Geeks1, Geeks2, Geeks3, and Geeks4" "Geeks1, Geeks2, Geeks3, or Geeks4" "Geeks1 Geeks2 Geeks3 Geeks4" Example 2: In this example, we will return a string from an array using the Intl.ListFormat.prototype.format() method in JavaScript. javascript <script> const gfg = ['Geeks1', 'Geeks2', 'Geeks3', 'Geeks4']; const result1 = new Intl.ListFormat('hi', { style: 'long', type: 'conjunction' }); console.log(result1.format(gfg)); const result2 = new Intl.ListFormat('hi', { style: 'short', type: 'disjunction' }); console.log(result2.format(gfg)); const result3 = new Intl.ListFormat('hi', { style: 'narrow', type: 'unit' }); console.log(result3.format(gfg)); </script> Output: "Geeks1, Geeks2, Geeks3, और Geeks4" "Geeks1, Geeks2, Geeks3 या Geeks4" "Geeks1, Geeks2, Geeks3 Geeks4" We have a complete list of Javascript Intl methods, to check those please go through the Javascript Intl Complete Reference article. Supported Browsers: The browsers supported by Intl.ListFormat.prototype.format() method are listed below: Google Chrome 72 and aboveEdge 79 and aboveFirefox 78 and aboveOpera 60 and aboveSafari 14.1 and above Comment More infoAdvertise with us Next Article JavaScript Intl ListFormat format() Method S SHUBHAMSINGH10 Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Methods JavaScript-Intl Similar Reads JavaScript Intl ListFormat formatToParts() Method The Intl.ListFormat.prototype.formatToParts() method is an inbuilt method in JavaScript that returns an Array of objects representing the different components that can be used to format a list of values in a locale-aware fashion. Syntax: Intl.ListFormat.prototype.formatToParts(list) Parameters: This 2 min read JavaScript Intl ListFormat() Constructor JavaScript Intl.ListFormat() Constructor is used for creating Intl.ListFormat object. This constructor is created using the new keyword. If we create the constructor without the new keyword it will give a TypeError. Syntax: new Intl.ListFormat(loc, opt) Parameters: It has two parameters both are opt 2 min read MessageFormat format() method in Java with Example : Set - 1 The format() method of java.text.MessageFormat class is used to get the formatted array of object appended into the string buffer object. formatted array will contain all forms of element lies in the pattern of MessageFormat object.Syntax: public final StringBuffer format(Object[] arguments, StringB 3 min read MessageFormat format() method in Java with Example : Set - 2 The format() method of java.text.MessageFormat class is used to get the formatted array of object according to the specified pattern of message format object. new string pattern will be considered while performing the action.Syntax: public static String format(String pattern, Object... arguments) Pa 2 min read Java String format() Method In Java, the String.format() method allows us to create a formatted string using a specified format string and arguments. We can concatenate the strings using this method, and at the same time, we can format the output with options such as width, alignment, decimal places, and more.Example: In the e 4 min read ChoiceFormat format() method in Java with Examples The format() method of java.text.ChoiceFormat class is used to get the appended string builder of the format value of particular limit value passed as parameter and text passed as parameter in this method. Syntax: public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition statu 2 min read MessageFormat formatToCharacterIterator() method in Java with Example The formatToCharacterIterator() method of java.text.MessageFormat class is used to format an array of object and insert them into the pattern of message format object.Syntax: public AttributedCharacterIterator formatToCharacterIterator(Object arguments) Parameter: This method takes array of object a 2 min read MessageFormat setFormat() method in Java with Example The setFormats() method of java.text.MessageFormat class is used to set the new format element at the particular index in the pattern of this message format object. Syntax: public void setFormat(int formatElementIndex, Format newFormat) Parameters: This method takes the following argument as a param 2 min read MessageFormat getFormats() method in Java with Example The getFormats() method of java.text.MessageFormat class is used to get the formats used for previously set pattern for the message format object.Syntax: public Format[] getFormats() Parameter: This method does not take any argument as a parameter.Return Value: This method returns format used for pr 2 min read PrintStream format(String, Object) method in Java with Examples The format(String, Object) method of PrintStream Class in Java is used to print a formatted string in the stream. The string is formatted using specified format and arguments passed as the parameter. Syntax: public PrintStream format(String format, Object...args) Parameters: This method accepts two 2 min read Like