Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SiliconStudio.Core.StringExtensions Class Reference

Extensions for string class. More...

Static Public Member Functions

static string SafeTrim (this string value)
 Safely trim a string. More...
 
static int IndexOf (this StringBuilder builder, char testChar)
 Calculates the index of a char inside the following StringBuilder, equivalent of string.IndexOf(char) for a StringBuilder. More...
 
static int LastIndexOf (this StringBuilder builder, char testChar, int startIndex=0)
 Calculates the last index of a char inside the following StringBuilder, equivalent of string.LastIndexOf(char) for a StringBuilder. More...
 
static string Substring (this StringBuilder builder, int startIndex)
 
static string Substring (this StringBuilder builder, int startIndex, int length)
 
static bool EndsWith (this string stringToTest, char endChar)
 Determines whether the end of this string ends by the specified character. More...
 
static bool EndsWith (this string stringToTest, params char[] endChars)
 Determines whether the end of this string ends by the specified characters. More...
 
static string ToFormat (this string stringToFormat, params object[] argumentsToFormat)
 Extension to format a string using string.Format(string,object) method by allowing to use it directly on a string. More...
 
static int IndexOfReverse (this string text, char charToFind, int matchCount=1)
 Reports the index number, or character position, of the first occurrence of the specified Unicode character in the current String object. The search starts at a specified character position starting from the end and examines a specified number of character positions. More...
 
static int IndexOfReverse (this string text, char charToFind, int startIndexFromEnd, int count, int matchCount=1)
 Reports the index number, or character position, of the first occurrence of the specified Unicode character in the current String object. The search starts at a specified character position starting from the end and examines a specified number of character positions. More...
 
static bool Contains (this string text, char value)
 Indicate if the string contains a character. More...
 

Detailed Description

Extensions for string class.

Definition at line 12 of file StringExtensions.cs.

Member Function Documentation

static bool SiliconStudio.Core.StringExtensions.Contains ( this string  text,
char  value 
)
static

Indicate if the string contains a character.

Parameters
textThe text
valueThe character to look for.
Returns
A boolean indicating if at least one instance of value is present in text

Definition at line 190 of file StringExtensions.cs.

static bool SiliconStudio.Core.StringExtensions.EndsWith ( this string  stringToTest,
char  endChar 
)
static

Determines whether the end of this string ends by the specified character.

Parameters
stringToTestThe string automatic test.
endCharThe end character.
Returns
true if the end of this string ends by the specified character, false otherwise.

Definition at line 86 of file StringExtensions.cs.

static bool SiliconStudio.Core.StringExtensions.EndsWith ( this string  stringToTest,
params char[]  endChars 
)
static

Determines whether the end of this string ends by the specified characters.

Parameters
stringToTestThe string automatic test.
endCharsThe end characters.
Returns
true if the end of this string ends by the specified character, false otherwise.

Definition at line 98 of file StringExtensions.cs.

static int SiliconStudio.Core.StringExtensions.IndexOf ( this StringBuilder  builder,
char  testChar 
)
static

Calculates the index of a char inside the following StringBuilder, equivalent of string.IndexOf(char) for a StringBuilder.

Parameters
builderThe builder.
testCharThe test character.
Returns
A position to the character found, or -1 if not found.
Exceptions
System.ArgumentNullExceptionbuilder

Definition at line 32 of file StringExtensions.cs.

static int SiliconStudio.Core.StringExtensions.IndexOfReverse ( this string  text,
char  charToFind,
int  matchCount = 1 
)
static

Reports the index number, or character position, of the first occurrence of the specified Unicode character in the current String object. The search starts at a specified character position starting from the end and examines a specified number of character positions.

Parameters
textThe text.
charToFindThe character automatic find.
matchCountThe number of match before stopping. Default is 1
Returns
The character position of the value parameter for the specified character if it is found, or -1 if it is not found.
Exceptions
System.ArgumentNullExceptiontext
System.ArgumentOutOfRangeExceptionmatchCount;matchCount must be >= 1

Definition at line 126 of file StringExtensions.cs.

static int SiliconStudio.Core.StringExtensions.IndexOfReverse ( this string  text,
char  charToFind,
int  startIndexFromEnd,
int  count,
int  matchCount = 1 
)
static

Reports the index number, or character position, of the first occurrence of the specified Unicode character in the current String object. The search starts at a specified character position starting from the end and examines a specified number of character positions.

Parameters
textThe text.
charToFindThe character automatic find.
startIndexFromEndThe starting index number for the search relative to the end of the string.
countThe number of character positions to be examined.
matchCountThe number of match before stopping. Default is 1
Returns
The character position of the value parameter for the specified character if it is found, or -1 if it is not found.
Exceptions
System.ArgumentNullExceptiontext
System.ArgumentOutOfRangeExceptioncount;Count must be a positive value or startIndexFromEnd;StartIndexFromEnd must be a positive value or startIndexFromEnd;StartIndexFromEnd must be within the range of the string length or count;Count must be in the range of the string length minus the startIndexFromEnd

Definition at line 161 of file StringExtensions.cs.

static int SiliconStudio.Core.StringExtensions.LastIndexOf ( this StringBuilder  builder,
char  testChar,
int  startIndex = 0 
)
static

Calculates the last index of a char inside the following StringBuilder, equivalent of string.LastIndexOf(char) for a StringBuilder.

Parameters
builderThe builder.
testCharThe test character.
startIndexThe start index.
Returns
A position to the character found, or -1 if not found.
Exceptions
System.ArgumentNullExceptionbuilder

Definition at line 55 of file StringExtensions.cs.

static string SiliconStudio.Core.StringExtensions.SafeTrim ( this string  value)
static

Safely trim a string.

Parameters
valueThe string value. can be null
Returns
The string trimmed.May be null if string was null

Definition at line 19 of file StringExtensions.cs.

static string SiliconStudio.Core.StringExtensions.Substring ( this StringBuilder  builder,
int  startIndex 
)
static

Definition at line 70 of file StringExtensions.cs.

static string SiliconStudio.Core.StringExtensions.Substring ( this StringBuilder  builder,
int  startIndex,
int  length 
)
static

Definition at line 75 of file StringExtensions.cs.

static string SiliconStudio.Core.StringExtensions.ToFormat ( this string  stringToFormat,
params object[]  argumentsToFormat 
)
static

Extension to format a string using string.Format(string,object) method by allowing to use it directly on a string.

Parameters
stringToFormatThe string automatic format.
argumentsToFormatThe arguments automatic format.
Returns
A formatted string. See string.Format(string,object)

Definition at line 111 of file StringExtensions.cs.


The documentation for this class was generated from the following file: