Let us say the following is your string −String str = "Welcome to our website!";Create a char array of the string included above using the ToCharArray() method:char []ch = str.ToCharArray();To convert the first character to uppercase −if (ch[i] >= 'a' && ch[i] = 'a' && val[i] = 'A' && val[i]
Moving objects are those whose position changes frequently over a period of time. Conventional databases don't know how to handle this scenario, as they assume the data objects are stationaryIn this case, we use moving object databases. These databases can store information about moving objects and allow querying on them.For example- The location of nearest taxis for a particular customer can be found using querying on moving object databases.The approaches used in handling moving object databases are:Location ManagementThe current locations of the objects are saved in the database and estimations are made on their near future positions. This information is ... Read More
Mandatory and optional participation are observed in E-R models between 2 different entities.Mandatory ParticipationIn the mandatory participation, for every instance of entity A, there must exist an instance of entity B and vice versa.An example of Mandatory participation would be relationship between mother and child. The child entity would exist only if there were a mother and similarly a mother would exist only if there were a childOptional participationIn optional participation, it is not necessary for all the instances of the entity to participate in a relationship. It may be that the number of instances participating for a particular entity ... Read More
ER model is used to represent real life scenarios as entities. The properties of these entities are their attributes in the ER diagram and their connections are shown in the form of relationships.Some examples of ER model are −Hospital ER ModelThis is an ER model of a Hospital. The entities are represented in rectangular boxes and are Patient, Tests and Doctor.Each of these entities have their respective attributes which are −Patients - ID(primary key), name, age, visit_dateTests- Name(primary key), date, resultDoctor- ID(primary key), name, specializationThe relationships between different entities are represented by a diamond shaped box.Company ER ModelThe entities in this ... Read More
To check if a string contains any special character, you need to use the following method −Char.IsLetterOrDigitUse it inside for loop and check or the string that has special characters.Let us say our string is −string str = "Amit$#%";Now convert the string into character array −str.ToCharArray();With that, use a for loop and to check for each character using the isLetterOrDigit() method.ExampleLet us see the complete code.Live Demousing System; namespace Demo { class myApplication { static void Main(string[] args) { string str = "Amit$#%"; char[] one = str.ToCharArray(); ... Read More
To check if a string is palindrome or not, you need to first find the reverse of the string using −Array.reverse()After that use the equals() method to match the original string with the reversed. If the result is true, that would mean the string is Palindrome.ExampleLet us try the complete example. Here, our string is “Malayalam”, which is when reversed gives the same result.Live Demousing System; namespace palindromecheck { class Program { static void Main(string[] args) { string string1, rev; string1 = "Malayalam"; char[] ... Read More
To define a variable in C++, you need to use the following syntax −Syntaxdatatype variable_name;You need to know what type of data is your variable is going to hold and what it will be called. The variable name has constraints on what you can name it. Following are the rules for naming variables −Variable names in C++ can range from 1 to 255 characters.All variable names must begin with a letter of the alphabet or an underscore(_).After the first initial letter, variable names can also contain letters and numbers. Variable names are case sensitive.No spaces or special characters are allowed.You ... Read More
While creating a password, you may have seen the validation requirements on a website like a password should be strong and have −Min 8 char and max 14 charOne lower caseNo white spaceOne upper caseOne special charLet us see how to check the conditions one by one −Min 8 char and max 14 charif (passwd.Length < 8 || passwd.Length > 14) return false;Atleast one lower caseif (!passwd.Any(char.IsLower)) return false;No white spaceif (passwd.Contains(" ")) return false;One upper caseif (!passwd.Any(char.IsUpper)) return false;Check for one special characterstring specialCh = @"%!@#$%^&*()?/>.
For an Armstrong number, let us say a number has 3 digits, then the sum of cube of its digits is equal to the number itself.For example, 153 is equal to −1³ + 3³ + 5³To check for it using C#, check the value and find its remainder. Here “val” is the number you want to check for Armstrong −for (int i = val; i > 0; i = i / 10) { rem = i % 10; sum = sum + rem*rem*rem; }Now compare the addition with the actual value. If it matches, that would mean the ... Read More
Firstly, declare the character array and set the value of each character −char[] ch = new char[5]; ch[0] = 'H'; ch[1] = 'e'; ch[2] = 'l'; ch[3] = 'l'; ch[4] = 'o';Now, use the string class constructor and create a new string from the above array of characters −string myChar = new string(ch);ExampleLet us see the code to convert a list of characters to string in C#.Live Demousing System; namespace Demo { class MyApplication { static void Main(string[] args) { char[] ch = new char[5]; ch[0] = ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP