Archive for 2017
Saturday, April 22nd, 2017
Object oriented programming (OOP) is a programming paradigm, which uses objects and their interactions for building computer programs.
Through this concept, programming tries to simulate the real world. In real world, we can have objects like a car, an orange, a dog.… Read more
Tags: class, object oriented programming, object variable type, objects, OOP
Posted in Objects | No Comments »
Friday, April 21st, 2017
I was explaining at some point that string is an immutable type. That means that once you assign a value to a string variable, you cannot directly modify it anymore. This also means that any string operation using any function such as Trim(), Replace(), ToUpper(), etc, will actually create a new string in memory where the resulting value will be stored, and it will delete the old, initial value. … Read more
Tags: concatenation, concatenator operator, string operations, string variable type, stringbuilder
Posted in Strings And Text Processing | No Comments »
Friday, April 21st, 2017
There are a number of other string methods that you might find useful. They are:
Compare(), CompareTo(), CompareOrdinal() – determines the sort order of strings. It checks if one string is ordered before another when in alphabetical order, whether it is ordered after, or is equivalent.… Read more
Tags: clone, compare, equals, insert, join, string operations, string variable type
Posted in Strings And Text Processing | No Comments »
Friday, April 21st, 2017
Sometimes, and specially when working with validating data such as registration forms, you want to get rid of any characters that are “parasitic”, what the programmers refer to as white spaces. White spaces are characters that are not observable at a first glance, like tabs, a space or a new line character.… Read more
Tags: remove, string operations, string variable type, trim, trimming, white space
Posted in Strings And Text Processing | No Comments »
Friday, April 21st, 2017
There are many cases when we have a string that contains some elements separated by a separator, and we would need to get these elements. For this, we can use the Split() function, which returns an array of strings. The alternative would be to manually search for the separator character using IndexOf() function, then to retrieve the individual substring, and all the extra horrendous work that comes with it.… Read more
Tags: split, string operations, string variable type
Posted in Strings And Text Processing | No Comments »
Friday, April 21st, 2017
A substring is a string located inside another string. To extract a portion of a string (substring), we can use the Substring() method, with some additional parameters, such as the starting index and the character count or length. Whenever the length parameter is omitted, the function will simply return the substring that starts at the specified index until the end of the string.… Read more
Tags: indexof, lastindexof, string operations, string variable type, substring
Posted in Strings And Text Processing | No Comments »