Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * do some operations with strings
- */
- void testStrings() {
- String text = "Shop is not very good place.";
- System.out.println(text.substring(3));
- System.out.println(text.indexOf('.'));
- System.out.println(text.charAt(15));
- }
- /**
- * visualise some functions with locale and format
- */
- void testFormatAndLocale() {
- double price = 56655.34;
- System.out.printf("this price is %f \n", price);
- String francePrice = NumberFormat.getCurrencyInstance(Locale.FRANCE).format(price);
- String chinaPrice = NumberFormat.getCurrencyInstance(Locale.CHINA).format(price);
- System.out.println(francePrice + '\n' + chinaPrice);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement