names

package
v1.0.0-b001 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2018 License: MIT, MIT Imports: 2 Imported by: 0

README

Name Parser

This is a simple library to parse names into their constituent parts.

It is (very largely) based off of PHP-Name-Parser.

##Example

import "github.com/blend/go-sdk/name-parser"
//...
name := names.Parse("Mr. Potato McTater, III")
fmt.Printf("%#v\n", name) 
/*
> name{Salutation:"Mr.", FirstName:"Potato", MiddleName:"", LastName:"McTater", Suffix:"III"}
*/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Name

type Name struct {
	Salutation string
	FirstName  string
	MiddleName string
	LastName   string
	Suffix     string
}

Name is a structured/parsed name.

func Parse

func Parse(input string) *Name

Parse parses a string into a name.

func (Name) String

func (n Name) String() string

String returns the string representation of a name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL