Update README.md

This commit is contained in:
Fabio Lima 2023-08-30 03:37:05 -03:00 committed by GitHub
parent d7e0bc6024
commit c7191c6e27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -201,11 +201,15 @@ Get the creation instant of a ULID:
Instant instant = ulid.getInstant(); // 2007-02-16T02:13:14.633Z Instant instant = ulid.getInstant(); // 2007-02-16T02:13:14.633Z
``` ```
---
```java ```java
// static method // static method
Instant instant = Ulid.getInstant("0123456789ABCDEFGHJKMNPQRS"); // 2007-02-16T02:13:14.633Z Instant instant = Ulid.getInstant("0123456789ABCDEFGHJKMNPQRS"); // 2007-02-16T02:13:14.633Z
``` ```
---
Get only the time component substring: Get only the time component substring:
```java ```java
@ -213,6 +217,8 @@ String ulidTimePart = ulid.toString()
.substring(0, Ulid.TIME_CHARS); // 0123456789 .substring(0, Ulid.TIME_CHARS); // 0123456789
``` ```
---
Get only the random component substring: Get only the random component substring:
```java ```java
@ -220,6 +226,8 @@ String ulidRandPart = ulid.toString()
.substring(Ulid.TIME_CHARS, Ulid.RANDOM_CHARS); // ABCDEFGHJKMNPQRS .substring(Ulid.TIME_CHARS, Ulid.RANDOM_CHARS); // ABCDEFGHJKMNPQRS
``` ```
---
Insert a string between the time and random components efficiently (avoiding concatenation) ([#29](https://github.com/f4b6a3/ulid-creator/pull/29)): Insert a string between the time and random components efficiently (avoiding concatenation) ([#29](https://github.com/f4b6a3/ulid-creator/pull/29)):
```java ```java