Header menu logo FSharp.Data

NameUtils Module

Tools for generating nice member names that follow F# & .NET naming conventions

Functions and values

Function or value Description

capitalizeFirstLetter s

Full Usage: capitalizeFirstLetter s

Parameters:
    s : string

Returns: string
s : string
Returns: string

niceCamelName s

Full Usage: niceCamelName s

Parameters:
    s : string

Returns: string

Turns a given non-empty string into a nice 'camelCase' identifier

s : string
Returns: string

nicePascalName s

Full Usage: nicePascalName s

Parameters:
    s : string

Returns: string

Turns a given non-empty string into a nice 'PascalCase' identifier

s : string
Returns: string

pluralize s

Full Usage: pluralize s

Parameters:
    s : string

Returns: string

Return the plural of an English word

s : string
Returns: string

singularize s

Full Usage: singularize s

Parameters:
    s : string

Returns: string

Return the singular of an English word

s : string
Returns: string

trimHtml s

Full Usage: trimHtml s

Parameters:
    s : string

Returns: string

Trim HTML tags from a given string and replace all of them with spaces Multiple tags are replaced with just a single space. (This is a recursive implementation that is somewhat faster than regular expression.)

s : string
Returns: string

uniqueGenerator niceName

Full Usage: uniqueGenerator niceName

Parameters:
    niceName : string -> string

Returns: string -> string
 Given a function to format names (such as 'niceCamelName' or 'nicePascalName')
 returns a name generator that never returns duplicate name (by appending an
 index to already used names)

 This function is curried and should be used with partial function application:

     let makeUnique = uniqueGenerator nicePascalName
     let n1 = makeUnique "sample-name"
     let n2 = makeUnique "sample-name"
niceName : string -> string
Returns: string -> string

Type something to start searching.