@@ -12,7 +12,7 @@ import nls = require('vs/nls');
1212export var empty = '' ;
1313
1414/**
15- * Returns the provided number with the given number of preceeding zeros.
15+ * Returns the provided number with the given number of preceding zeros.
1616 */
1717export function pad ( n : number , l : number , char : string = '0' ) : string {
1818 var str = '' + n ;
@@ -114,14 +114,14 @@ export function escapeRegExpCharacters(value: string): string {
114114}
115115
116116/**
117- * Searches for all occurances of needle in haystack and replaces them with replacement.
117+ * Searches for all occurrences of needle in haystack and replaces them with replacement.
118118 */
119119export function replaceAll ( haystack : string , needle : string , replacement : string ) : string {
120120 return haystack . replace ( new RegExp ( escapeRegExpCharacters ( needle . toString ( ) ) , 'g' ) , replacement ) ;
121121}
122122
123123/**
124- * Removes all occurances of needle from the beginning and end of haystack.
124+ * Removes all occurrences of needle from the beginning and end of haystack.
125125 * @param haystack string to trim
126126 * @param needle the thing to trim (default is a blank)
127127 */
@@ -131,7 +131,7 @@ export function trim(haystack: string, needle: string = ' '): string {
131131}
132132
133133/**
134- * Removes all occurances of needle from the beginning of haystack.
134+ * Removes all occurrences of needle from the beginning of haystack.
135135 * @param haystack string to trim
136136 * @param needle the thing to trim
137137 */
@@ -155,7 +155,7 @@ export function ltrim(haystack?: string, needle?: string): string {
155155}
156156
157157/**
158- * Removes all occurances of needle from the end of haystack.
158+ * Removes all occurrences of needle from the end of haystack.
159159 * @param haystack string to trim
160160 * @param needle the thing to trim
161161 */
@@ -189,7 +189,7 @@ export function rtrim(haystack?: string, needle?: string): string {
189189}
190190
191191/**
192- * Removes all occurances of whitespaces from the beginning and end of haystack.
192+ * Removes all occurrences of whitespaces from the beginning and end of haystack.
193193 */
194194export function trimWhitespace ( haystack : string ) : string {
195195 return haystack . replace ( / ( ^ \s + | \s + $ ) / g, '' ) ;
@@ -512,7 +512,7 @@ export function difference(first: string, second: string, maxLenDelta: number =
512512 if ( lengthDifference > maxLenDelta ) {
513513 return 0 ;
514514 }
515- // Initiliaze LCS (largest common subsequence) matrix.
515+ // Initialize LCS (largest common subsequence) matrix.
516516 var LCS : number [ ] [ ] = [ ] ;
517517 var zeroArray : number [ ] = [ ] ;
518518 var i : number , j : number ;
0 commit comments