string-0.3.0: Common things for strings

Safe HaskellSafe-Inferred

Strings

Contents

Description

Extra functions and classes for dealing with Strings.

Synopsis

Re-exports

module Data.Char

Data operations

lower :: String -> StringSource

Lower case a string.

upper :: String -> StringSource

Upper case a string.

trim :: String -> StringSource

Trim a string.

ellipsize :: Int -> String -> StringSource

Limit the length of the string and ellipsize it.

ellipsizeFromFront :: Int -> String -> StringSource

Limit the length of a string and ellipsize it if it goes over a certain length.

ordSuffix :: Integral n => n -> StringSource

Add a suffix to an integral.

padSource

Arguments

:: Int

Times.

-> String

Pad.

-> String

String.

-> String

Padded string.

Pad the string with the given string.

stringToMaybe :: String -> Maybe StringSource

If a trimmed string is empty, return nothing.

Classes

class ToString a whereSource

A class for converting to strings.

Methods

toString :: a -> StringSource

Instances