2 releases
| 0.1.1 | May 25, 2025 |
|---|---|
| 0.1.0 | Apr 6, 2025 |
#18 in #create-instance
112 downloads per month
Used in 4 crates
(via macron)
5KB
String Macro
Introduction:
Creates a new instance of String.
P.s.: More useful macros you can find here.
Examples:
// simple string:
let s = str!("Hello, World!");
assert_eq!(s, "Hello, World!");
// from integer:
let s = str!(10);
assert_eq!(s, "10");
// from refference:
let r = 10.2;
let s = str!(r);
assert_eq!(s, "10.2");
// string formatting with arguments:
let s = str!("Hello, {}!", "World");
assert_eq!(s, "Hello, World!");
// string formatting with named arguments:
let name = "World";
let s = str!("Hello, {name}!");
assert_eq!(s, "Hello, World!");
Licensing:
Distributed under the MIT license.
Feedback:
You can contact me via GitHub or send a message to my Telegram @fuderis.
This library is constantly evolving, and I welcome your suggestions and feedback.
Dependencies
~160–570KB
~14K SLoC