среда, 10 августа 2016 г.

работа с символами rune в Golang

    str := "\"RECT\""
    fmt.Println(str)

    // Get rune slice.
    // ... Modify the slice's data.
    ch := []rune(str)
    ch[0] = 'y'
    ch = append(ch, 'e')

    // Create new string from modified slice.
    result := string(ch)

    fmt.Println(result)

Комментариев нет:

Отправить комментарий