|
-
Mar 17th, 2025, 06:18 AM
#1
Thread Starter
Junior Member
String Interpolation, String Formatting, Composite Formatting, Template Literals
Hi! Seniors,
Please suggest good libs/code for VB6/VBA and should be competitive with following languages.
Code:
| C# (.NET) |
Composite Formatting |
String.Format("{0}, {1}", "Hello", "World") |
|
String Interpolation ($"...") |
$"Hello, {name}!" |
| Python |
String Formatting (str.format) |
"Hello, {}!".format("World") |
|
f-strings (String Interpolation, Python 3.6+) |
f"Hello, {name}!" |
| Java |
Formatting with String.format |
String.format("%s, %s", "Hello", "World") |
| JavaScript |
Template Literals |
`Hello, ${name}!` |
|
String Concatenation (Basic) |
"Hello, " + name + "!" |
| Ruby |
Interpolation with #{} |
"Hello, #{name}!" |
|
sprintf or format |
sprintf("Hello, %s!", name) |
| PHP |
Double-Quoted Strings with Variables |
"Hello, $name!" |
|
sprintf |
sprintf("Hello, %s!", $name) |
| C++ |
printf/sprintf |
sprintf(buffer, "Hello, %s!", name); |
|
String Interpolation (C++20, std::format) |
std::format("Hello, {}!", name) |
| Go |
fmt.Sprintf |
fmt.Sprintf("Hello, %s!", name) |
| Rust |
Formatting Macros |
format!("Hello, {}!", name) |
| Kotlin |
String Templates |
"Hello, $name!" |
|
String.format (Java-style) |
"Hello, %s!".format(name) |
| Swift |
String Interpolation |
print("Hello, \(name)!") |
| Perl |
String Interpolation (Double-Quoted Strings) |
"Hello, $name!" |
|
sprintf |
sprintf("Hello, %s!", $name) |
| Dart |
String Interpolation |
'Hello, $name!' |
| Lua |
String Formatting |
string.format("Hello, %s!", name) |
| Objective-C |
String Formatting with NSString |
[NSString stringWithFormat:@"Hello, %@!", name] |
| Shell Scripts |
Interpolation (Double-Quoted Strings) |
"Hello, $name!" |
| R |
sprintf |
sprintf("Hello, %s!", name) |
Thank you!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|