Skip to content

Commit

Permalink
fix Chr usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Iiqbal2000 committed Oct 6, 2022
1 parent acf4f77 commit 7dd2538
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions go/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,22 @@ fmt.Println(pehape.Ucwords(bar))
fmt.Println(pehape.Strrev(bar))
//result : "kasur rusak"
```

* `Chr`
```go
var AInASCII = pehape.Chr(65)
fmt.Println(AInASCII)
var charFromNumber = pehape.Chr(65)
fmt.Println(charFromNumber)
//result : "A"
var charFromOctal = pehape.Chr(053)
fmt.Println(charFromOctal)
//result: "+"
var charFromHex = pehape.Chr(0x52)
fmt.Println(charFromHex)
//result: "R"
var symbol = pehape.Chr(240) + pehape.Chr(159) + pehape.Chr(144) + pehape.Chr(152)
fmt.Println(symbol)
```

* `Chr`
```go
var charFromNumber = pehape.Chr(65)
fmt.Println(charFromNumber)
//result : "A"

var charFromOctal = pehape.Chr(053)
fmt.Println(charFromOctal)
//result: "+"

var charFromHex = pehape.Chr(0x52)
fmt.Println(charFromHex)
//result: "R"

var symbol = pehape.Chr(240) + pehape.Chr(159) + pehape.Chr(144) + pehape.Chr(152)
fmt.Println(symbol)
//result : "🐘"
```

0 comments on commit 7dd2538

Please sign in to comment.