Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
code_snippets:csharp_snippets [2014/06/17 18:18] smarkcode_snippets:csharp_snippets [2014/06/19 16:19] (current) smark
Line 40: Line 40:
 </code> </code>
  
-=== int OccurancesInString(String Haystack, String Needle) === +=== int OccurrencesInString(String Haystack, String Needle) === 
 +Counts the number of occurrences of Needle in Haystack.
 <code c#> <code c#>
 /// <summary> /// <summary>
-/// Counts the number of occurances of Needle in Haystack.+/// Counts the number of occurrences of Needle in Haystack.
 /// </summary> /// </summary>
 /// <param name="Haystack">String being search</param> /// <param name="Haystack">String being search</param>
 /// <param name="Needle">String being searched for</param> /// <param name="Needle">String being searched for</param>
 /// <returns>Integer representing the number of occurances of Needle in Haystack</returns> /// <returns>Integer representing the number of occurances of Needle in Haystack</returns>
-public static int OccurancesInString(String Haystack, String Needle) {+public static int OccurrencesInString(String Haystack, String Needle) {
  return Regex.Matches(Haystack, Needle).Count;  return Regex.Matches(Haystack, Needle).Count;
 } }
Line 55: Line 55:
  
 === void PrintArrayList(ArrayList InputArray) === === void PrintArrayList(ArrayList InputArray) ===
 +Prints an ArrayList object to the console.
 <code c#> <code c#>
 /// <summary> /// <summary>
Line 70: Line 70:
  
 === void DumpByteArrayToFile(byte[] inputBytes, String FileName) === === void DumpByteArrayToFile(byte[] inputBytes, String FileName) ===
 +Dumps a byte[] Array to a file.
 <code c#> <code c#>
 /// <summary> /// <summary>
Line 88: Line 88:
  
 === void DumpStringToFile(String inputString, String FileName) === === void DumpStringToFile(String inputString, String FileName) ===
 +Dumps a String to a file.
 <code c#> <code c#>
 /// <summary> /// <summary>
Line 106: Line 106:
  
 === void PrintCharArrASCII(char[] inputCharArr) === === void PrintCharArrASCII(char[] inputCharArr) ===
 +Prints the ASCII values of every character in a character array delimited by a pipe character to the Console.
 <code c#> <code c#>
 /// <summary> /// <summary>
Line 122: Line 122:
  
 === void PrintStringASCII(String inputStr) === === void PrintStringASCII(String inputStr) ===
 +Prints the ASCII values of every character in a string delimited by a pipe character to the Console.
 <code c#> <code c#>
 /// <summary> /// <summary>
Line 139: Line 139:
  
 === void PrintByteArrASCII(byte[] inputByteArr) === === void PrintByteArrASCII(byte[] inputByteArr) ===
 +Prints the ASCII values of every character in a character array delimited by a pipe character to the Console.
 <code c#> <code c#>
 /// <summary> /// <summary>
code_snippets/csharp_snippets.txt · Last modified: 2014/06/19 16:19 by smark
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0