Horje
nim string interpolation Code Example
nim string interpolation
import strutils, strformat
var apples = 4
var bananas = 3
echo "I have $1 apples".format(apples)
echo fmt"I have {apples} apples"
echo fmt"I have {apples + bananas} fruits"

# Multi-line
echo fmt"""
I have 
{apples} apples"""

# Debug the formatting
echo fmt"I have {apples=} apples"

# Custom openChar and closeChar characters
echo fmt("I have (apples) {apples}", '(', ')')

# Backslash inside the formatted string literal
echo fmt"""{ "yep\nope" }"""




Whatever

Related
Check if Numbers Are Ascending in a Sentence Code Example Check if Numbers Are Ascending in a Sentence Code Example
istioctl proxy-status Code Example istioctl proxy-status Code Example
done icon Code Example done icon Code Example
DPKG_BUILDFLAGS_EXPORT_ENVVAR Code Example DPKG_BUILDFLAGS_EXPORT_ENVVAR Code Example
Haskell check for list equality Code Example Haskell check for list equality Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8