# solidity-string-utils

> Simplify dumping data as string in solidity.

Latest version **0.0.8-0** (published 2022-07-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install solidity-string-utils
pnpm add solidity-string-utils
yarn add solidity-string-utils
bun add solidity-string-utils
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8-0 |
| Published | 2022-07-12 |
| First published | 2020-03-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | drortirosh |

## Links

- npm: https://www.npmjs.com/package/solidity-string-utils
- npm.io page: https://npm.io/package/solidity-string-utils

## Recent versions

- 0.0.8-0 (latest) — 2022-07-12
- 0.0.7 — 2021-02-10
- 0.0.6 — 2021-02-10
- 0.0.5 — 2020-06-17
- 0.0.4 — 2020-05-14
- 0.0.3 — 2020-03-19
- 0.0.2 — 2020-03-19
- 0.0.1 — 2020-03-19

## README

# solidity string utilities.

Simplify dumping data as string in solidity.

Optimized for usability, and not for gas.

Mostly useful in testing by generating meaningful revert messages.

Currently supports `toString()` method for `uint`, `address`, `bytes32`, `bool`, `int` and `string`

Also provides `concat()` methods for those types, but only with 2 and 3 params.
For longer params, use multiple `concat` calls or `abi.encodePacked()`

e.g.

```solidity
import "solidity-string-utils/StringUtils.sol";

contract MyContract {

    using StringUtils for *;

    function someMethod() public {


        require(condition, "condition not met"
            .concat( " a=", a)
            .concat( " b=", b)
        );

        revert(string(abi.encodePacked(
                "asd",
                a.toString(),
                b.toString(),
                c.toString(),
                d.toString(),
                e.toString()
            )));
    }

}
```

---
_Source: https://npm.io/package/solidity-string-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
