Add String Interpolation Notation

String Interpolation would allow for easier creation of string messages.

The following message:

"Number of transactions " + TransactionData.Rows.Count.ToString + ", with the last processed being " + TransactionNumber.ToString + " with current status " + TransactionStatus

Would turn into:

$"Number of transactions: {TransactionData.Rows.Count}, with the last processed being {TransactionNumber} with current status {TransactionStatus}"

It’s a much cleaner way to express the same information, and I would strongly suggest its inclusion.

It’s synonymous with:

String.Format("Number of transactions: {0}, with the last processed being {1} with current status {2}", TransactionData.Rows.Count, TransactionNumber, TransactionStatus)

However, this method removes the declaration from the string, which makes it hard to figure out where each belongs.

2 posts were merged into an existing topic: String Interpolation