varfruit=newFruit();fruit.type="apple";fruit.color="RED";fruit.shippingDate=newDate(2018,1,1);fruit.amount=10000;String.Format("the {type:U} is {color:L} shipped on {shippingDate:s} with an amount of {amount:n}",fruit);// output: the APPLE is red shipped on 2018-01-01 with an amount of 10.000
returns true value if given parameter is either null, empty or undefined.
format, args
Format
Method
Converts the value of objects to strings based on the formats specified and inserts them into another string.
format, args
Join
Method
Combines arguments delimited by given seperator.
delimiter,args
Join
Method
Combines arguments delimited by given seperator from array.
delimiter,array
StringBuilder
Just like you know from C#,
varfavoriteFruit: string=this.fruitService.getFavorite();//Blueberriesvarbuilder=newStringBuilder("My favorite fruits are: ");builder.Append("Apples, ");builder.Append("Bananas ");// of course using String.Format()builder.AppendFormat("and especially {0:U}!",favoriteFruit);builder.AppendFormat(" I eat {0} every day!",10);varfruits=builder.ToString();//output: "My favorite fruits are: Apples, Bananas and especially BLUEBERRIES! I eat 10 every day!";