names

package
v1.0.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2018 License: 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

Overview

Package names contains helpers for parsing names.

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 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