Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/wallclockbuilder/stringutil

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/wallclockbuilder/stringutil

  • v0.0.0-20151229105100-650d35b119a3
  • Source
  • Go
  • Socket score

Version published
Created
Source

#stringutil Build Status GoDoc Readability Ruby's string manipulation magic brought to Golang

Why?

"What was the biggest surprise you encountered rolling out Go?" I knew the answer instantly: Although we expected C++ programmers to see Go as an alternative, instead most Go programmers come from languages like Python and Ruby. Robert Pike, Less is exponentially more

stringutil makes all the string manipulation methods from ruby accessible in go.

##Install

 go get https://github.com/wallclockbuilder/stringutil

##Import

 import "stringutil" "https://github.com/wallclockbuilder/stringutil"

Example

I want to remove the trailing space from the end of a string.

This is what Go forces me to do:

strings.TrimRightFunc(s, unicode.IsSpace)

This is the simple version from Ruby:

stringutil.Rstrip(s)

I prefer the Ruby version.

##Use

package main
import "github.com/wallclockbuilder/stringutil"

func main() {
  stringutil.Capitalize("abcde")          #=> "ABCDE"
  stringutil.Reverse("stressed")          #=> "desserts"
  stringutil.Swapcase("Hello")            #=> "hELLO"
}

##Documentation go doc style documentation for this package is available online at http://godoc.org/github.com/wallclockbuilder/stringutil

Contributing

  1. Fork it ( https://github.com/wallclockbuilder/stringutil )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

FAQs

Package last updated on 29 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc