Skip to content

Commit 30352f1

Browse files
authored
docs: update readme
1 parent 9c2c411 commit 30352f1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ let address1 = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
5858
BasedUtils.shortenAddress(address1) // "0xd8dA...6045"
5959
```
6060

61+
### Extensions
62+
63+
String
64+
```swift
65+
let address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
66+
let hash = "d8dA6B"
67+
hash.addHexPrefix() // "0xd8dA6B"
68+
address.addHexPrefix() // "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" (only adds if it doesn't exist)
69+
address.removeHexPrefix() // "d8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
70+
```
71+
6172
## Dependencies
6273

6374
- [BigInt](https://github.com/attaswift/BigInt)

0 commit comments

Comments
 (0)