TilePlus Version 5
Unity3D Tilemap Extension
Loading...
Searching...
No Matches
TilePlus.PerkinsStringUtils Class Reference

String utilities. More...

Static Public Member Functions

static List< string > WordWrap (this string text, int maxCharactersPerLine, bool breakWords=false, char? hyphenChar='-', int hyphenatedWordMinLength=1)
 Takes in a string and splits it into multiple lines (array indices) of a specified length. If a word is too long to fit on a line, the word gets moved to the next line (the next array index)

Detailed Description

String utilities.

Member Function Documentation

◆ WordWrap()

List< string > TilePlus.PerkinsStringUtils.WordWrap ( this string text,
int maxCharactersPerLine,
bool breakWords = false,
char? hyphenChar = '-',
int hyphenatedWordMinLength = 1 )
static

Takes in a string and splits it into multiple lines (array indices) of a specified length. If a word is too long to fit on a line, the word gets moved to the next line (the next array index)

Parameters
textThe text to word wrap
maxCharactersPerLineThe maximum characters per line
breakWordsDetermine if words should fit as many as possible on current line, with remaining broken up to the next line
hyphenCharThe character to use at the end of the line as a hyphen when breaking up words
hyphenatedWordMinLengthThe minimum length of the hyphenated word after it is broken up. A word will not be hyphenated unless it meets this minimum length after it is broken up
Returns
A list of strings that contains each line limited by the specified length

The returned list is re-used (cleared) and modified every time this method is used.


The documentation for this class was generated from the following file:
  • /Users/jms/Documents/Tpt_55/TPT55/Assets/Plugins/TilePlus/Runtime/StaticLib/ThirdParty/PerkinsStringUtils.cs