C# Class CTFBot.CTFUtils

Show file Open project: countervandalism/Cluekie

Public Methods

Method Description
ParseDateTimeLength ( string input, int defaultLen ) : int

Like PHP's strtotime() function, attempts to parse a GNU date/time into number of seconds

getRawDocument ( string url ) : string

Gets the raw source code for a URL

replaceStrMax ( string input, char oldChar, char newChar, int maxChars ) : string

Replaces up to the maximum number of old characters with new characters in a string

stringSplit ( string input, int chunkLen ) : ArrayList

Like PHP's str_split() function, splits a string into an array of chunks

wikiEncode ( string input ) : string

Encodes a string for use with wiki URLs

Method Details

ParseDateTimeLength() public static method

Like PHP's strtotime() function, attempts to parse a GNU date/time into number of seconds
public static ParseDateTimeLength ( string input, int defaultLen ) : int
input string String representation of date/time length
defaultLen int
return int

getRawDocument() public static method

Gets the raw source code for a URL
public static getRawDocument ( string url ) : string
url string Location of the resource
return string

replaceStrMax() public static method

Replaces up to the maximum number of old characters with new characters in a string
public static replaceStrMax ( string input, char oldChar, char newChar, int maxChars ) : string
input string The string to work on
oldChar char The character to replace
newChar char The character to insert
maxChars int The maximum number of instances to replace
return string

stringSplit() public static method

Like PHP's str_split() function, splits a string into an array of chunks
public static stringSplit ( string input, int chunkLen ) : ArrayList
input string String to split
chunkLen int Maximum length of each chunk
return System.Collections.ArrayList

wikiEncode() public static method

Encodes a string for use with wiki URLs
public static wikiEncode ( string input ) : string
input string
return string