Does C have a string type? [closed]

C does not and never has had a native string type. By convention, the language uses arrays of char terminated with a null char, i.e., with ‘\0′. Functions and macros in the language’s standard libraries provide support for the null-terminated character arrays, e.g., strlen iterates over an array of char until it encounters a ‘\0’ …

Read more

Using JavaScript to perform text matches with/without accented characters

There is a way to ““deaccent” the string being compared” without the use of a substitution function that lists all the accents you want to remove… Here is the easiest solution I can think about to remove accents (and other diacritics) from a string. See it in action: var string = ‘Ça été Mičić. ÀÉÏÓÛ’; …

Read more

Encode a FileStream to base64 with c#

An easy one as an extension method public static class Extensions { public static Stream ConvertToBase64(this Stream stream) { byte[] bytes; using (var memoryStream = new MemoryStream()) { stream.CopyTo(memoryStream); bytes = memoryStream.ToArray(); } string base64 = Convert.ToBase64String(bytes); return new MemoryStream(Encoding.UTF8.GetBytes(base64)); } }