Skip to content

Remove strange space character as defined by Unicode's White Space property

Notifications You must be signed in to change notification settings

purwokertodev/replacer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Replacer

Replace space character as defined by Unicode's White Space property (https://golang.org/pkg/unicode/#IsSpace)

Build Status forthebadge forthebadge

Usage

  • Install
    go get github.com/purwokertodev/replacer
  • Example
    package main
    
    import (
      "fmt"
      "github.com/purwokertodev/replacer"
    )
    
    func main() {
    
      stringWithStrangeSpace := "sometimes i feel \n my heart \t so lonely"
    
      r1 := replacer.Replace(stringWithStrangeSpace, " ")
      r2 := replacer.Replace(stringWithStrangeSpace, "_")
    
      fmt.Println(r1) // sometimes i feel my heart so lonely
      fmt.Println(r2) // sometimes_i_feel_my_heart_so_lonely
    }

About

Remove strange space character as defined by Unicode's White Space property

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages