Method | Description | |
---|---|---|
AutoHyperlinks ( string strVar, string param ) : String |
and tags are ignored. Any linkable items within a [nolink][/nolink] or
|
|
AutoNoFollow ( string strVar, string param ) : String |
Add rel="nofollow" property to any anchor tags in a string, so web search engines won't evaluate links and give them added weight.
|
|
CaseInsenstiveReplace ( string input, string oldValue, string newValue ) : String |
A case insenstive replace method.
|
|
CompareStrings ( String source, String values, System.Boolean caseSensitive ) : System.Boolean |
Compare a string to the values in a string array, returning "true" if any match.
|
|
ConvertFractions ( String text ) : String |
Convert fractions like "1/3" to fancy, single-character symbolic HTML encoded fractions.
|
|
ConvertLinefeeds ( string strVar, string feedType ) : String |
or tags, except between [nofeed][/nofeed] tags. ]]>
|
|
ConvertToHtml ( string strVal, bool lineFeeds, string feedType ) : String |
sequences or
|
|
ConvertToHtml ( string strVal, bool lineFeeds, string feedType, bool hyperLinks, string linkParams ) : String |
sequences or
|
|
Crop ( string strVar, int xNumber, CropType cropType ) : String |
Return the current string cropped by number of words or characters. Words: returns the first "xNumber" of words in the string, including any intermediate punctuation, etc. Trailing punctuation is always removed. Characters: returns the first "xNumber" of characters in the string, including any intermediate punctuation, etc. When it locates the last character, it scans ahead to make sure it's not breaking a word. If it is in the middle of a word, it will skip ahead to the next non-alpha-numeric chatacter and break on that, so your cropped string may be slightly larger than the number of characters you requested. Trailing punctuation is always removed.
|
|
Crop ( string strVar, int xNumber, CropType cropType, string xChars ) : String |
Return the current string cropped by number of words or characters. Words: returns the first "xNumber" of words in the string, including any intermediate punctuation, etc. Trailing punctuation is always removed. Characters: returns the first "xNumber" of characters in the string, including any intermediate punctuation, etc. When it locates the last character, it scans ahead to make sure it's not breaking a word. If it is in the middle of a word, it will skip ahead to the next non-alpha-numeric chatacter and break on that, so your cropped string may be slightly larger than the number of characters you requested. Trailing punctuation is always removed.
|
|
Crop ( string strVar, int xNumber, CropType cropType, string xChars, string endWhenCropped ) : String |
Return the current string cropped by number of words or characters. Words: returns the first "xNumber" of words in the string, including any intermediate punctuation, etc. Trailing punctuation is always removed. Characters: returns the first "xNumber" of characters in the string, including any intermediate punctuation, etc. When it locates the last character, it scans ahead to make sure it's not breaking a word. If it is in the middle of a word, it will skip ahead to the next non-alpha-numeric chatacter and break on that, so your cropped string may be slightly larger than the number of characters you requested. Trailing punctuation is always removed.
|
|
FilterWords ( string input ) : String |
Removes all the words passed in the filter words parameters. The replace is NOT case sensitive.
|
|
FilterWords ( string input, char mask ) : String |
Removes all the words passed in the filter words parameters. The replace is NOT case sensitive.
|
|
FixNull ( string strVar ) : String |
Fixes null string variable references.
|
|
FormatNumber ( System.Int64 value, NumberFormats format ) : String |
Formats a number for output.
|
|
FormatNumber ( string value, NumberFormats format ) : String |
Formats a number for output.
|
|
FormatPercentage ( int value, int total, int places ) : String |
Generates a percentage, formatted with "places" decimal places.
|
|
FormatTelephoneNumber ( string phoneNumber, TelephoneFormat telephoneFormat ) : String |
Formats a telephone number. For U.S. 10-digit numbers, if a leading "1" is included, it is stripped prior to formatting.
|
|
GenerateUniqueString ( ) : String |
Creates a unique, cryptic text string (based on GUID) for use in cookies, and more.
|
|
HasWords ( string input ) : |
Checks the passed string to see if it has any of the passed words; not case-sensitive.
|
|
HtmlDecodeSymbols ( string sourceString ) : String |
|
|
HtmlEncode ( string text ) : String |
Fully encode a string for use on a URL, within a mailto link. In a basic sense, it encodes text using HttpUtility.UrlEncode, but then further converts "+" symbols to "%20".
|
|
HtmlEncodeSymbols ( string sourceString ) : String |
|
|
HtmlRemoveSymbols ( string sourceString ) : String |
Remove all occurrences of HTML-friendly escape sequences (entities).
|
|
InStr ( int start, string string1, string string2 ) : |
Clone of the ASP InStr function. Finds the starting location of a substring.
|
|
InStr ( string string1, string string2 ) : |
Clone of the ASP InStr function. Finds the starting location of a substring.
|
|
Left ( string stringData, int i ) : String |
Return the leftmost "i" characters from string, or "" if invalid length is passed.
|
|
MakeLink ( string strVal, string url ) : String |
style link, based on passed parameters. ]]>
|
|
MakeLink ( string strVal, string url, string title ) : String |
style link, based on passed parameters. ]]>
|
|
MakeLink ( string strVal, string url, string title, string target, string className ) : String |
style link, based on passed parameters. ]]>
|
|
Mid ( string stringData, int startIndex ) : String |
Return a substring from a specific character posiiton in the string, to the end of the string.
|
|
Mid ( string stringData, int startIndex, int length ) : String |
Return a substring, or "" if invalid params are passed.
|
|
ReplaceFirst ( string input, string oldValue, string newValue ) : String |
Replaces the first occurrence of a string with the replacement value. The Replace is case senstive.
|
|
ReplaceLast ( string input, string oldValue, string newValue ) : String |
Replaces the last occurrence of a string with the replacement value. The replace is case senstive.
|
|
Right ( string stringData, int i ) : String |
Return the rightmost "i" characters from string, or "" if invalid length is passed.
|
|
Right ( string stringData, string marker ) : String |
Return the rightmost characters from string up to the first occurrence of "Marker".
|
|
SanitizeEscapes ( string strVar ) : String |
Return the current string with all escape sequences (e.g. ") changed to appropriate and ASCII characters (e.g. "), so dangerous markup can more easily be identified.
|
|
SentenceCase ( string input ) : String |
Converts a string to sentence case.
|
|
SmartNav ( string classString, string urlString, int recordCount, int perPage, int currentPage, string elipses ) : String |
Returns HTML in a string for a flickr-style button navigation. "classString" controls the name of the surrounding DIV tag, so the style sheet can be customized and assigned to the SmartNav.
|
|
SmartNav ( string classString, string urlString, int recordCount, int perPage, int currentPage, string elipses, bool showPreviousNext, string prevText, string nextText, int buttonCount ) : String |
Returns HTML in a string for a flickr-style button navigation. "classString" controls the name of the surrounding DIV tag, so the style sheet can be customized and assigned to the SmartNav.
|
|
SmartNav ( string classString, string urlString, int recordCount, int perPage, int currentPage, string elipses, bool showPreviousNext, string prevText, string nextText, int buttonCount, System.Boolean leftToRight ) : String |
Returns HTML in a string for a flickr-style button navigation. "classString" controls the name of the surrounding DIV tag, so the style sheet can be customized and assigned to the SmartNav.
|
|
SqlSuperSanitize ( string strVar ) : String |
to \r\n\r\n and
|
|
StrToByteArray ( string str ) : byte[] |
Convert a string to a byte array.
|
|
StripDangerousProperties ( string strVar ) : String |
Remove all occurrences of dangerous tag properties from a string. Helps to prevent injected javascript from running, etc.
|
|
StripEmailHeaderProperties ( string strVar ) : String |
Remove all occurrences of dangerous email header properties from a string. This is used to prevent someone from inserting code into submitted form data that will trick the page into sending mail to other people. E-mail header text that will be removed includes: "x-mailer:", "x-rcpt-to:", "x-uidl:", "content-transfer-encoding:", "content-type:", "mime-version:", "x-sender:", "bcc:", "cc:", "x-receiver:"
|
|
StripHtml ( string strVar, bool convertBreaks, bool keepLinks ) : String |
Return the current string with HTML tags removed.
|
|
StripScripts ( string strVar ) : String |
Return the current string with potentially dangerous script tags removed. Dangerous scriptable tags that are removed include: applet, body, embed, frame, script, frameset, html, iframe, img, style, layer, link, ilayer, meta, object. javascript properties injected into other tags are also removed.
|
|
StripSpecificTag ( string strVar, string tagName ) : String |
Return the current string with all instances of a specific tag removed.
|
|
SubStringCount ( string src, char find ) : |
Returns the number of times a character or substring occurs within a string.
|
|
SubStringCount ( string src, string find ) : |
Returns the number of times a character or substring occurs within a string.
|
|
SuperSanitize ( string strVar ) : String |
to \r\n\r\n and
|
|
TitleCase ( string input ) : String |
Converts a string to title case.
|
|
TitleCase ( string input, bool ignoreShortWords ) : String |
Converts a string to title case.
|
|
Trim ( String sourceString ) : String |
Trim leading and trailing white space from a string, including line breaks, em's, en's, tabs, etc.
|
|
TrimIntraWords ( string input ) : String |
Removes multiple spaces between words.
|
|
UnFormatFileSize ( string fileSize ) : Decimal |
Converts a file size string into a number of equivalent bytes. Used to convert strings like "115KB" to a number or actual bytes.
|
|
UrlRewriteText ( string input ) : String |
Creates a URL-compatible string from plain text. Ideal for use with URL rewriting when you want to link to an article based on its headline text, and not a cryptic path like "pagename.aspx?ID=1234". Replaces any number of sequential non-alphanumeric characters with a single hyphen character. The returned string will have all leading and trailing hyphens stripped as well. For example, "(Now is the time, I swear.)" becomes "Now-is-the-time-I-swear"
|
|
WordWrap ( string input, int charCount ) : String |
Wraps the passed string up until the next whitespace on or after the total charCount has been reached for that line. Uses the environment new line symbol for the break text.
|
|
WordWrap ( string input, int charCount, bool cutOff ) : String |
Wraps the passed string up until the total number of characters (if cuttOff is true) or until the next whitespace (if cutOff is false). Uses the environment new line symbol for the break text.
|
|
WordWrap ( string input, int charCount, bool cutOff, string breakText ) : String |
Wraps the passed string at a given character count per line (if cuttOff is true) or until the next whitespace after the given length (if cutOff is false). Uses the passed breakText for lineBreaks.
|
Method | Description | |
---|---|---|
H3Text ( ) : System |
public static AutoHyperlinks ( string strVar, string param ) : String | ||
strVar | string | String to process. |
param | string | /// tags, like target="_blank". /// ]]> /// |
return | String |
public static AutoNoFollow ( string strVar, string param ) : String | ||
strVar | string | String to process. |
param | string | Additional params to add to the link, like target="_blank". |
return | String |
public static CaseInsenstiveReplace ( string input, string oldValue, string newValue ) : String | ||
input | string | The string to examine. |
oldValue | string | The value to replace. |
newValue | string | The new value to be inserted. |
return | String |
public static CompareStrings ( String source, String values, System.Boolean caseSensitive ) : System.Boolean | ||
source | String | String to compare against. |
values | String | String array of values to compare. |
caseSensitive | System.Boolean | Evaluate equality based on case, or not. |
return | System.Boolean |
public static ConvertFractions ( String text ) : String | ||
text | String | Text to process |
return | String |
public static ConvertLinefeeds ( string strVar, string feedType ) : String | ||
strVar | string | String to convert. |
feedType | string |
/// " or " ". /// ]]> /// |
return | String |
public static ConvertToHtml ( string strVal, bool lineFeeds, string feedType ) : String | ||
strVal | string | Text to process. |
lineFeeds | bool | Convert lineFeeds to HTML equivalents (true or false). |
feedType | string |
/// " or " ". /// ]]> /// |
return | String |
public static ConvertToHtml ( string strVal, bool lineFeeds, string feedType, bool hyperLinks, string linkParams ) : String | ||
strVal | string | Text to process. |
lineFeeds | bool | Convert lineFeeds to HTML equivalents (true or false). |
feedType | string |
/// " or " ". /// ]]> /// |
hyperLinks | bool | Convert urls and domain names to hyperLinks (true or false). |
linkParams | string | If converting urls and domain names to hyperLinks, add these params to the anchor tags. |
return | String |
public static Crop ( string strVar, int xNumber, CropType cropType ) : String | ||
strVar | string | String to process. |
xNumber | int | Number of words or characters to return (as close as possible). |
cropType | CropType | Enum value: CropType.Characters or CropType.Words. |
return | String |
public static Crop ( string strVar, int xNumber, CropType cropType, string xChars ) : String | ||
strVar | string | String to process. |
xNumber | int | Number of words or characters to return (as close as possible). |
cropType | CropType | Enum value: CropType.Characters or CropType.Words. |
xChars | string | Valid characters to break on (defaults to space characters). |
return | String |
public static Crop ( string strVar, int xNumber, CropType cropType, string xChars, string endWhenCropped ) : String | ||
strVar | string | String to process. |
xNumber | int | Number of words or characters (as close as possible) to return. |
cropType | CropType | Enum value: CropType.Characters or CropType.Words. |
xChars | string | Valid characters on which to break (defaults to space characters). |
endWhenCropped | string | String to append to the return value, only if the string had to be cropped. |
return | String |
public static FilterWords ( string input ) : String | ||
input | string | The string to search. |
return | String |
public static FilterWords ( string input, char mask ) : String | ||
input | string | The string to search. |
mask | char | A character that is inserted for each letter of the replaced word. |
return | String |
public static FixNull ( string strVar ) : String | ||
strVar | string | String variable to fix. |
return | String |
public static FormatNumber ( System.Int64 value, NumberFormats format ) : String | ||
value | System.Int64 | Numeric value to format. |
format | NumberFormats | Enumeration with preset number formats. |
return | String |
public static FormatNumber ( string value, NumberFormats format ) : String | ||
value | string | Numeric value to format. |
format | NumberFormats | Enumeration with preset number formats. |
return | String |
public static FormatPercentage ( int value, int total, int places ) : String | ||
value | int | Value for which a percentage is needed. |
total | int | Total of all values from which to generate a percentage /// (divided by "value" parameter). |
places | int | Number of decimal places to return in the percentage string. |
return | String |
public static FormatTelephoneNumber ( string phoneNumber, TelephoneFormat telephoneFormat ) : String | ||
phoneNumber | string | The phone number. |
telephoneFormat | TelephoneFormat | TelephoneFormat constant which defines how the telephone number should be formatted. |
return | String |
public static GenerateUniqueString ( ) : String | ||
return | String |
public static HasWords ( string input ) : |
||
input | string | The string to check. |
return |
public static HtmlDecodeSymbols ( string sourceString ) : String | ||
sourceString | string | String to filter. |
return | String |
public static HtmlEncode ( string text ) : String | ||
text | string | Text value to encode. |
return | String |
public static HtmlEncodeSymbols ( string sourceString ) : String | ||
sourceString | string | String to filter. |
return | String |
public static HtmlRemoveSymbols ( string sourceString ) : String | ||
sourceString | string | String to filter. |
return | String |
public static InStr ( int start, string string1, string string2 ) : |
||
start | int | Starting character position (1 is first character). |
string1 | string | Source string. |
string2 | string | Search string. |
return |
public static InStr ( string string1, string string2 ) : |
||
string1 | string | Source string. |
string2 | string | Search string. |
return |
public static Left ( string stringData, int i ) : String | ||
stringData | string | String to process. |
i | int | Number of characters to return. |
return | String |
public static MakeLink ( string strVal, string url ) : String | ||
strVal | string | Text to make into a link (text to wrap with anchor tags). |
url | string | URL to which the link should point. |
return | String |
public static MakeLink ( string strVal, string url, string title ) : String | ||
strVal | string | Text to make into a link (text to wrap with anchor tags). |
url | string | URL to which the link should point. |
title | string | Text for the "title" and "alt" properties of the anchor tag. |
return | String |
public static MakeLink ( string strVal, string url, string title, string target, string className ) : String | ||
strVal | string | Text to make into a link (text to wrap with anchor tags). |
url | string | URL to which the link should point. |
title | string | Text for the "title" and "alt" properties of the anchor tag. |
target | string | Destination for the "target" property of the anchor tag. |
className | string | Class name with which to style the anchor tag. |
return | String |
public static Mid ( string stringData, int startIndex ) : String | ||
stringData | string | String to process. |
startIndex | int | Substring begins at this character position, to the end of the string. |
return | String |
public static Mid ( string stringData, int startIndex, int length ) : String | ||
stringData | string | String to process. |
startIndex | int | Substring begins at this character position. |
length | int | Substring is this many characters. |
return | String |
public static ReplaceFirst ( string input, string oldValue, string newValue ) : String | ||
input | string | The string to examine. |
oldValue | string | The value to replace. |
newValue | string | the new value to be inserted. |
return | String |
public static ReplaceLast ( string input, string oldValue, string newValue ) : String | ||
input | string | The string to examine. |
oldValue | string | The value to replace. |
newValue | string | the new value to be inserted. |
return | String |
public static Right ( string stringData, int i ) : String | ||
stringData | string | String to process. |
i | int | Number of characters to return. |
return | String |
public static Right ( string stringData, string marker ) : String | ||
stringData | string | String to process. |
marker | string | Substring to use to truncate right side of string. |
return | String |
public static SanitizeEscapes ( string strVar ) : String | ||
strVar | string | String to process. |
return | String |
public static SentenceCase ( string input ) : String | ||
input | string | The string to convert. |
return | String |
public static SmartNav ( string classString, string urlString, int recordCount, int perPage, int currentPage, string elipses ) : String | ||
classString | string | Name of the surrounding DIV tag so style sheet can customized. |
urlString | string | Base url for navigating pages. Page number is appended to the end of this for links. |
recordCount | int | Number of total records in the database. Used to calculate page count. |
perPage | int | Number of total records listed per page. Used to calculate page count. |
currentPage | int | Current page number. |
elipses | string | Text or HTML to show between button segments (e.g. " ... "). |
return | String |
public static SmartNav ( string classString, string urlString, int recordCount, int perPage, int currentPage, string elipses, bool showPreviousNext, string prevText, string nextText, int buttonCount ) : String | ||
classString | string | Name of the surrounding DIV tag so style sheet can customized. |
urlString | string | Base url for navigating pages. Page number is appended to the end of this for links. |
recordCount | int | Number of total records in the database. Used to calculate page count. |
perPage | int | Number of total records listed per page. Used to calculate page count. |
currentPage | int | Current page number. |
elipses | string | Text or HTML to show between button segments (e.g. " ... "). |
showPreviousNext | bool | true, show "Previous" and "Next" buttons; false, do not. |
prevText | string | Text for the previous page button. |
nextText | string | Text for the next page button. |
buttonCount | int | How many buttons to show without breaking up the nav (values 6 and up). |
return | String |
public static SmartNav ( string classString, string urlString, int recordCount, int perPage, int currentPage, string elipses, bool showPreviousNext, string prevText, string nextText, int buttonCount, System.Boolean leftToRight ) : String | ||
classString | string | Name of the surrounding DIV tag so style sheet can customized. |
urlString | string | Base url for navigating pages. Page number is appended to the end of this for links. |
recordCount | int | Number of total records in the database. Used to calculate page count. |
perPage | int | Number of total records listed per page. Used to calculate page count. |
currentPage | int | Current page number. |
elipses | string | Text or HTML to show between button segments (e.g. " ... "). |
showPreviousNext | bool | true, show "Previous" and "Next" buttons; false, do not. |
prevText | string | Text for the previous page button. |
nextText | string | Text for the next page button. |
buttonCount | int | How many buttons to show without breaking up the nav (values 6 and up). |
leftToRight | System.Boolean | Left to Right layoutto left. |
return | String |
public static SqlSuperSanitize ( string strVar ) : String | ||
strVar | string | String to sanitize. |
return | String |
public static StrToByteArray ( string str ) : byte[] | ||
str | string | String to convert to a byte array. |
return | byte[] |
public static StripDangerousProperties ( string strVar ) : String | ||
strVar | string | String to process. |
return | String |
public static StripEmailHeaderProperties ( string strVar ) : String | ||
strVar | string | String to process. |
return | String |
public static StripHtml ( string strVar, bool convertBreaks, bool keepLinks ) : String | ||
strVar | string | String to process. |
convertBreaks | bool |
/// " and " " to \r\n and converts "" to \r\n\r\n. /// ]]> /// |
keepLinks | bool | Keep and anchor tags intact. |
return | String |
public static StripScripts ( string strVar ) : String | ||
strVar | string | String to process. |
return | String |
public static StripSpecificTag ( string strVar, string tagName ) : String | ||
strVar | string | String to process. |
tagName | string | Tag name to strip (e.g. blockquote) |
return | String |
public static SubStringCount ( string src, char find ) : |
||
src | string | String to search. |
find | char | Character to count. |
return |
public static SubStringCount ( string src, string find ) : |
||
src | string | String to search. |
find | string | Substring to count. |
return |
public static SuperSanitize ( string strVar ) : String | ||
strVar | string | String to sanitize. |
return | String |
public static TitleCase ( string input ) : String | ||
input | string | The string to convert. |
return | String |
public static TitleCase ( string input, bool ignoreShortWords ) : String | ||
input | string | The string to convert. |
ignoreShortWords | bool | If true, does not capitalize the most common 70 prepositions. |
return | String |
public static Trim ( String sourceString ) : String | ||
sourceString | String | String to trim. |
return | String |
public static TrimIntraWords ( string input ) : String | ||
input | string | The string to trim. |
return | String |
public static UnFormatFileSize ( string fileSize ) : Decimal | ||
fileSize | string | String file size to convert to a number of bytes /// (e.g. "103kb", "15 MB", "1TB", "37.6GB", et al.). |
return | Decimal |
public static UrlRewriteText ( string input ) : String | ||
input | string | The string to process (usually a subject or headline). |
return | String |
public static WordWrap ( string input, int charCount ) : String | ||
input | string | The string to wrap. |
charCount | int | The number of characters per line. |
return | String |
public static WordWrap ( string input, int charCount, bool cutOff ) : String | ||
input | string | The string to wrap. |
charCount | int | The number of characters per line. |
cutOff | bool | If true, will break in the middle of a word. |
return | String |
public static WordWrap ( string input, int charCount, bool cutOff, string breakText ) : String | ||
input | string | The string to wrap. |
charCount | int | The number of characters per line. |
cutOff | bool | If true, will break in the middle of a word. |
breakText | string | The line break text to use. |
return | String |