Program To Find Middle Character In String In C

C program to remove consecutive repeated characters from string - C programming Example. Parameters pos Position of the first character to be copied as a substring. In this case the starting index is 6 because the first character of the substring is found at character 6 of the parent string. So to store a string, we need an array of characters followed by a null byte. Remember that C language does not support strings as a data type. Program to print a string character by character in C. Wrie a program to find out duplicate characters in a string. C Language: strcmp function (String Compare) In the C Programming Language, the strcmp function returns a negative, zero, or positive integer depending on whether the object pointed to by s1 is less than, equal to, or greater than the object pointed to by s2. The C++ Tutorial LearnCpp. isalpha() True >>> '123'. find gives you the position in the string and also accepts a starting position, so a little munging of data is needed:. This results in inconsistent command syntax and overlap of functionality, not to mention. Let's take a string of words like word1 word2 word3. Let us see how to write a C Program to find Factors of a Number using FOR LOOP, WHILE LOOP, Pointers, and FUNCTIONS. Replace InStr =. If you attempt to call a method on a null string, an exception will occur. A null byte ( character constant zero, '\0' ) is used as a terminator signal to mark the end of the string. Check if a string can become empty by recursively deleting a given sub-string. Getting the middle of a string. ” (terrific). It’s often hard to read regex patterns, so it may help to look at that multiple search pattern regex more generally, like this:. Extract Substring from the Middle of a String; Modify Characters Within a String; Get Length of String; Trim Trailing or Leading Blanks / Whitespace from a String; Fixed-Length Strings; Return ASCII Character Code of First Letter in String; Convert ASCII Value to Character; Create String with Repeating Characters; Case-Insensitive String Compare. In C programming, a string is a sequence of characters terminated with a null character \0. C++ STL MAP and multiMAP: Description, use and examples of C++ STL "pair", "map" and "multimap" associative containers. isdigit() True Note that they only check for those characters, so a string with spaces or anything else will return false for both:. e the number of characters strings will store. I'm working a problem that returns a string containing the character in str if the length of str is odd, or the two middle char if the length is even. However, support of ePUB and its many features varies across reading devices an. – asawyer Jul 16 '13 at 19:50 @asawyer Yes I'll edit the code accordingly in my project with exception handling and for checking null values. 9 Lists and strings A string is a sequence of characters and a list is a sequence of values, but a list of characters is not the same as a string. The following Java program demonstrates how this can be achieved. C Program to Find Number of Characters and Words in a String Search. The following is a table that lists the precedence and associativity of all the operators in the C and C++ languages (when the operators also exist in Java, Perl, PHP and many other recent languages, the precedence is the same as that given [citation needed]). Rob Pike 23 October 2013 Introduction. You even remembered to check for strings of less than two characters which I had forgotten to do. Assigning to and from a string: A ShortString is a fixed 255 characters. In the simplest case, x is a single character string, and strsplit outputs a one-item list. C Program To Replace A Character in String. Write a Java method to display the middle character of a string. From a report: UA strings have been developed part of the Netscape browser in the 90s, and have been in use ever since. Second is more interesting than first one, here we have used regular expression to find all words. Given a printable ASCII string, split it into a list of non-empty strings with a new sub-string beginning every time a character, which has not previously been seen in the same case, occu. py to find the bad characters in War-FTP. This program will read a string and remove repeated consecutive characters from the string and print new updated string. Search for occurrence of any character in a string - strpbrk. There is no function like strrev in C to reverse a string. Possible values for encoding are: s = single-7-bit-byte characters ( ASCII , ISO 8859, etc. For example, let us assume we have string "1,2,3,4,5" and we want to remove "3," from it to get the new string "1,2,4,5". Note that as you type each character, the regex is checked for syntax; if the syntax is OK, you see a checkmark beside it. For example: int c[] = "c string"; When the compiler encounters a sequence of characters enclosed in the double quotation marks, it appends a null character \0 at the end by default. Your VB6 program is capable of manipulating strings in any language containing any character -- whether it's Chinese, Japanese, Icelandic, Arabic, etc. The string s4 contains the character "À" encoded into wchar_t, if the UTF-16 encoding is used, then s4 will also contain only a single wchar_t, 16 bits long, with numerical value 0x00C0. C-Program to delete specified length of sub-string from given String. The position(s) of a character in a string can be found out by the following example. Write code that copies the contents of name to str if the C-string in name is not too big to fit in str. Hint: suffix sort. Multi-string Programs. Because the string contains all the characters in hackerrank in the same exact order as they appear in hackerrank, we print YES on a new line. A verbatim string literal consists of an @ character followed by a double-quote character, zero or more characters, and a closing double-quote character. In FORTRAN77 string types are declared as CHARACTER∗N, where N is a positive integer constant, as in CHARACTER∗80 LINE which declares the variable LINE to be a string of 80 characters. b) If the length of the string is even there will be one middle character. char arr[] = {'c','o','d','e','\0'};. C Program to Find Number of Characters and Words in a String Search. If there are less than k characters left, reverse all of them. and the space characters such as blankspace, tab character and new line character. The ToString method can accept a string parameter, which tells the object how to format itself - in the String. white space from beginning, end and between words then you can use replaceAll() method of String and pass regular expression \s to find and replace all white spaces including tab with empty string "". character if it is not already one. Manipulating Strings. In this tutorial, you will learn how to get middle character from the word. It doesn't need a separate buffer to hold the reversed string. How to use C# string Substring Substring in C# string Class returns a new string that is a substring of this string. For this you can use a very handy function : LEFT(). If count is missing (only the first two arguments are given), all the characters from other_string , starting at position and going to the end of other_string , are included in the new string. String indexing in Python is zero-based: the first character in the string has index 0, the next has index 1, and so on. To extract the characters, words, first, middle and last name from a cell, we use the formulas “LEFT”, “RIGHT”, “MID”, “LEN”, and “SEARCH” in Microsoft Excel. isalpha() True >>> '123'. , "%[^a- zA-Z]%" matches a string with a character that is not a letter between two percent signs). If the length of string is odd then ignore middle character. The ToString method can accept a string parameter, which tells the object how to format itself - in the String. Quite often we need to find and replace a character or substring within a string. " dmh2000's point is that if you have a null character embedded in the middle of an array of characters [i]and you are considering (e. An empty string contains no characters and has length 0, but other than that, it is the same as any other string. Fill a String with Repeating Characters. Brief list and quick reference guide on string parsing used in Arduino programming. In this article we will discuss about how to get middle character of a string in SQL. Since we need to capitalize first letter of each word the best method is to capitalize the character after the white space. A String is composed of characters thus removing characters will be an easy task. C Program to find All Occurrence of a Character in a String Example 1. use a function that loops through a string passed in as a parameter, and inside use a if statement to check if a character passed in as a parameter is equal to the index i of that string. First Non Repeated Character in String Find the first non-repeated (unique) character in a given string. Must know - Program to find length of string Logic to copy one string to another string. The characters of the string are : w 3 r e s o u r c e. Brief list and quick reference guide on string parsing used in Arduino programming. In the above syntax str_name is any name given to the string variable and size is used define the length of the string, i. Here is an example of getting the middle letter of the word entered by the user using Java. If the word has an even number of characters, inform the user that there is no middle character. Write a C program to count all occurrences of a character in a string using loop. The following is a table that lists the precedence and associativity of all the operators in the C and C++ languages (when the operators also exist in Java, Perl, PHP and many other recent languages, the precedence is the same as that given [citation needed]). You can also say the sprintf () function is used to create strings as output using formatted data. I have to swap the characters in a string before sending said string to a device to show the information sent through a LCD. The position(s) of a character in a string can be found out by the following example. Only replace first occurence: 17. Two strings s and t are reverse complements if t is the reverse of s except with the following substitutions A->T, C->G. Insert(int ind,string str). Online C++ strings programs and examples with solutions, explanation and output for computer science and information technology students pursuing BE, BTech, MCA, MTech, MCS, MSc, BCA, BSc. How to compare two strings in c without using strcmp 14. This results in inconsistent command syntax and overlap of functionality, not to mention. Strings are always defined inside double quotes ("Abc"), and characters are always defined inside single quotes ('A'). b) If the length of the string is even there will be one middle character. The longer the text string, the narrower the characters. You'll want both the and libraries, along with any others you may need for your specific program. Tags for Find the Position of the Given Character from a String in C. On computers running Microsoft Windows 2000 or Windows NT 4. Strings have methods isalpha and isdigit to test if they consist of letters and digits, respectively: >>> 'hello'. For these reasons, I chose not to include fscanf() in this presentation. We match each character with our search character. C Program To Replace A Character in String. This is a simple C source code written in Turbo C (OS- Windows 7) which can find position of any character from a given string. 7 or Python 3. NET String Class check the specified parameter String exist in the String. Insert(int ind,string str). Returns a new String with the last character removed. If this is equal to the string length, the function returns an empty string. #6 Write a program to ask the user for a series of words, and output the middle letter of the words if the word has an odd number of characters. C Program to find All Occurrence of a Character in a String Example 1. Rob Pike 23 October 2013 Introduction. The parent string array of characters is then looped through and at each iteration a conditional check is made to determine if the current parent string. Python program to replace character in a string with a symbol; Python tutorial to remove duplicate lines from a text file; Python program to find the maximum and minimum element in a list; Python program to find the multiplication of all elements in a list; Python program to find the square root of a number. A single string may contain characters in multiple languages. Find last index of a character in a string using C++ program In this post, we are going to learn: how we can find the last index of a character in a string using C/C++ program using simple method? Given a string, and we have to find last index of a character using C program. Print middle word in a string. Write code that copies the contents of name to str if the C-string in name is not too big to fit in str. A string is literally a string of characters. C Program to Count Number of Digits in a Number using While Loop. This program will remove consecutive repeated character from the string in C. We can do this with the str. Logic to count total occurrences of a character in a given string in C program. This C Program To Exchange Characters in an Array of Characters, also known as Strings uses three Block Structures:. Problem Solution 1. Practice #1: Using a literal string in SELECT statement. Test Data: Input a string: 350. Example Input Input string: I love … Continue reading C program to count occurrences of a character in a string →. The string s4 contains the character "À" encoded into wchar_t, if the UTF-16 encoding is used, then s4 will also contain only a single wchar_t, 16 bits long, with numerical value 0x00C0. You can also use this property to calculate the number of elements in a jQuery object. and the space characters such as blankspace, tab character and new line character. StringLengthTrim - Get and trim the length of a string. These are often used to create meaningful and readable programs. Following is the memory presentation of the above defined string in C/C++ − Actually, you do not place the null character at the end of a string constant. Problem Description This program will implement a one-dimentional array of some fixed size, filled with some random numbers, then will sort all the filled elements of the array. Within a bracket expression, a range expression consists of two characters separated by a hyphen. The position(s) of a character in a string can be found out by the following example. Online C++ strings programs and examples with solutions, explanation and output for computer science and information technology students pursuing BE, BTech, MCA, MTech, MCS, MSc, BCA, BSc. In this part of the C# programming tutorial, we will cover arrays. It must be a char*, not string (use s. This is a C Program to sort an array in ascending order. \" indicates a quote character, not the termination of a string. A verbatim string literal consists of an @ character followed by a double-quote character, zero or more characters, and a closing double-quote character. The parent string array of characters is then looped through and at each iteration a conditional check is made to determine if the current parent string. Write a program to find maximum repeated words from a file. e the number of characters strings will store. "unlimited" output needed is "ted" "987654" output needed is "654" "123456789" output needed is "789". py plugin for Immunity Debugger. The Contains method in the VB. The longer the text string, the narrower the characters. The only trick in the process is knowing that you can really strip/delete characters from a String using the technique shown here. [crayon-5e27a7a94549c805569497/] Educative Site Free Online Academic Courses Tutorials, Books with enough questions and answers. At their simplest, these functions help you search and replace a given character. This program will remove consecutive repeated character from the string in C. We will use 'for loop' and 'if-else' condition to solve it. Write a program to find top two maximum numbers in a array. To fill a string with repeating characters, use the string class constructor. For example, strings liril, abba are palindromes. Only replace first occurence: 17. Required knowledge. Write a program to find maximum repeated words from a file. C++ program to count no. Applying chop to an empty string returns an empty string. Here are some of the most common ones. Comparing Bad Character Strings with Mona. Copy and paste the following SQL to your SQLyog free Community Edition query window. Problem Solution 1. Match means that the entire string must match the regex, while Find means the regex must be found somewhere in the string (Find All counts the number of occurrences that are found). #chomp is often a safer alternative, as it leaves the string unchanged if it doesn’t end in a record separator. This pattern of computation—traversing a sequence and returning when we find what we are looking for—is called a search. C# array definition. First convert the string to an array of characters by using the toCharArray() method on the string. At their simplest, these functions help you search and replace a given character. How to find the first, last or nth occurrence of a character in Excel? Supposing you have the following list of text strings which including the character “-”, and now you want to get the last or nth occurrence of the character “-”, have you any good ideas to deal with this problem?. A little more detail would help. Create an array of fixed size (maximum capacity), lets say 10. A string is series of characters, where a character is the same as a byte. Both user and system header files are included using the preprocessing directive ‘#include’. StringIndexOf - Look for the first/last instance of a character in a string. StringStartsWithEndsWith - Check which characters/substrings a given string starts or ends with. Then it will ask to enter a character. , and there shouldn't be a problem. We print the positions. Using a 'for loop', it will find the first occurrence position and last occurrence position of the given character and print out the result. For example, in the default C locale, "[a-d]" is equivalent to "[abcd]". Here is an example of getting the middle letter of the word entered by the user using Java. Rob Pike 23 October 2013 Introduction. For input validation on a website, are there any security concerns with disclosing to the user exactly what characters are valid or invalid for a given field? CWE-200: Information Exposure says one. To get the position of a regular expression match(es) in a text string […]. The String class has a number of methods for examining the contents of strings, finding characters or substrings within a string, changing case, and other tasks. These programs has more than one string variables. use a function that loops through a string passed in as a parameter, and inside use a if statement to check if a character passed in as a parameter is equal to the index i of that string. As we use call by reference, we do not need to return the substring array. , default), S = single-8-bit-byte characters, b = 16-bit bigendian, l = 16-bit littleendian, B = 32-bit bigendian, L = 32-bit littleendian. sample code to find the position of the character; find the place where the character is situated; A program to find the character position in a string ; C Programme to input a string and check whether a particular character present in it. The maximum number of characters count on Twitter is 280, a Single-byte character uses 1 and a Double-byte character uses 2. If the length of string is odd then ignore middle character. Applying chop to an empty string returns an empty string. LEFT: Returns the first character(s) in a text string based on the number of characters specified. Because the string contains all the characters in hackerrank in the same exact order as they appear in hackerrank, we print YES on a new line. Individual characters in a string can be accessed by specifying the string name followed by a number in square brackets ([]). An Assembly Language Program to display a string. To build a string of variable length of. C# array definition. It has two variants: #include This variant is used for system header files. You can also use COERCE to convert any sequence of characters into a string. A string is series of characters, where a character is the same as a byte. C Language: strcmp function (String Compare) In the C Programming Language, the strcmp function returns a negative, zero, or positive integer depending on whether the object pointed to by s1 is less than, equal to, or greater than the object pointed to by s2. As we use call by reference, we do not need to return the substring array. Program to find string length without function in C. String: meant for texts such as "Hello" and "Good Morning!". C programmers are used to strings being sequences of characters ending in '\0', the nul or null character. Problem Solution 1. Applying chop to an empty string returns an empty string. py to automate the tedious byte by byte comparisons with the Mona. To extract the characters, words, first, middle and last name from a cell, we use the formulas “LEFT”, “RIGHT”, “MID”, “LEN”, and “SEARCH” in Microsoft Excel. Length Mid =. C Program to Find Number of Characters and Words in a String Search. the number of characters in the string): Using length() would just give you the length of the vector containing the string, which will be 1 if the string is just a single string. Also as with input field-splitting, if fieldsep is the null string, each individual character in the string is split into its own array element. If startpos is not specified, FIND starts the search at the beginning of the string and searches the string from left to right. Manipulating Strings. This will be in the form of a numerical value. C Program to Find the Frequency of Characters in a String In this example, you will learn to find the frequency of a character in a string. This produces a messagebox containing the number of characters in textbox1. In this tutorial, you will learn how to get middle character from the word. These are often used to create meaningful and readable programs. sample code to find the position of the character; find the place where the character is situated; A program to find the character position in a string ; C Programme to input a string and check whether a particular character present in it. Find the number which gets divided only once and consecutively print the character of the obtainedRead More. Be careful to only use this on char arrays that are being used as C-style strings. Getting the middle of a string. How to use C# string Insert The Insert() function in String Class will insert a String in a specified index in the String instance. C++ Shell, 2014-2015. Assigning to and from a string: A ShortString is a fixed 255 characters. Accessing characters in strings by index in Python. You already know the string length is greater than 1 from the check you did on line 2. Write a program in C# Sharp to print individual characters of the string in reverse order. For this you can use a very handy function : LEFT(). Can some one provide me the sample code in C or C++? Can any one Explain with a c program to printing tower in c and returning remaing stars ? C program to find out the maximum product using subarray of the given array?. Each String value has an associated index type, String. The function is usually written in C and, therefore, does not take advantage of the string manipulation routines built into the Intel microprocessor since its lowly 8086/8088 origins. Once the basic R programming control structures are understood, users can use the R language as a powerful environment to perform complex custom analyses of almost any type of data. I have used switch case to check for vowels, we can also do this using if statement. StringStartsWithEndsWith - Check which characters/substrings a given string starts or ends with. For input validation on a website, are there any security concerns with disclosing to the user exactly what characters are valid or invalid for a given field? CWE-200: Information Exposure says one. It can be a string of Char, AnsiChar or WideChar characters. Manipulating Strings. Solution of Program 1 of ISC 2017 Computer Science Paper 2 (Practical) Exam. Second is more interesting than first one, here we have used regular expression to find all words. IndexOf UCase =. For example: int c[] = "c string"; When the compiler encounters a sequence of characters enclosed in the double quotation marks, it appends a null character \0 at the end by default. The third one replaces content from index pos spanning n characters with the first n3 characters of cs starting at n2. How to swap two numbers without using temporary variable?. The String class has a number of methods for examining the contents of strings, finding characters or substrings within a string, changing case, and other tasks. User need to input the string and sub-string information. If the character doesn’t appear in the string, the program exits the loop normally and returns -1. There is no function like strrev in C to reverse a string. If the character doesn’t appear in the string, the program exits the loop normally and returns -1. C Program To Replace A Character in String. Please keep in mind that there is an extra terminating character which is the Null character ('\0') used to indicate termination of string which differs strings from normal. is an optional character constant, variable, or expression that initializes a list of characters. To find the frequency or occurrence of a particular characters present in the string or sentence in c++ programming, then ask to the user to enter the string, now start searching for that character and increase the number of presence and display the frequency of character present in the string. std::string::append vs std::string::push_back() vs Operator += in C++. NET 2002 and in Microsoft Visual C++. Your program must remove all occurrences of given character. For instance, to get the last 4 characters from the end of a string, use this formula: =RIGHT(A2,4) Extract text from middle of string (MID) If you are looking to extract a substring starting in the middle of a string, at the position you specify, then MID is the function you can rely on. Once the basic R programming control structures are understood, users can use the R language as a powerful environment to perform complex custom analyses of almost any type of data. A String is composed of characters thus removing characters will be an easy task. This is a C Program to display the characters in prime position of a given string. Strings, bytes, runes and characters in Go. For instance, if a program asks for your full name, including middle initial, it will first need to split that input into three separate strings before it can work with your individual first, middle and last name. ” (terrific). In this article we will discuss about how to get middle character of a string in SQL. It matches any single character that sorts between the two characters, inclusive, using the locale's collating sequence and character set. Also as with input field-splitting, if fieldsep is the null string, each individual character in the string is split into its own array element. Then it will ask to enter a character. Note that as you type each character, the regex is checked for syntax; if the syntax is OK, you see a checkmark beside it. char arr[] = {'c','o','d','e','\0'};. Two strings are isomorphic if the characters in s can be replaced to get t. C# Substring() Method. The only trick in the process is knowing that you can really strip/delete characters from a String using the technique shown here. For example, if given String is "aaaaa" and String to remove is "a" then output should be an empty String. C++ program to count no. Problem Description This program prints the characters in prime position of a given string. Mid function =Mid([SerialNumber],2,2) If [SerialNumber] is “CD234”, the result is “D2”. You can get the character at a particular index within a string by invoking the charAt() accessor method. 5 Strings are immutable. C++ program to store student details using class; C++ program to print the ASCII values of all characters of a string; C++ program to print values at odd and even index of an array; C example program to add numbers to an array; Different ways in Python to find the square of a number; Python program to print list elements in different ways. , "%[^a- zA-Z]%" matches a string with a character that is not a letter between two percent signs). Add the following lines to convert the program into an inexact-palindrome checker (i. strncmp — Binary safe string comparison of the first n characters; strpbrk — Search a string for any of a set of characters; strpos — Find the position of the first occurrence of a substring in a string; strrchr — Find the last occurrence of a character in a string; strrev — Reverse a string; strripos — Find the position of the last. Oracle's embedded SQL environment is called Pro*C. Instead an expression like s[8] returns a string-length-1 containing the character. In this article we will discuss about how to get middle character of a string in SQL. Now that you've defined the strings, you can start using them. Empty or “”). First Non Repeated Character in String Find the first non-repeated (unique) character in a given string. This makes the initialization of strings a bit different. You can also say the sprintf () function is used to create strings as output using formatted data. " dmh2000's point is that if you have a null character embedded in the middle of an array of characters [i]and you are considering (e. The C-style character string originated within the C language and continues to be supported within C++. #In Review# The character count logic on Twitter is different between Social Studio Web/Desktop and Social Studio Mobile App. In FORTRAN77 string types are declared as CHARACTER∗N, where N is a positive integer constant, as in CHARACTER∗80 LINE which declares the variable LINE to be a string of 80 characters. If the string ends with \r , both characters are removed. – asawyer Jul 16 '13 at 19:50 @asawyer Yes I'll edit the code accordingly in my project with exception handling and for checking null values. Of course, you can count the characters one by one, and get the exact position result. Format call, the formatting string is passed after the position, for example, "{0:##}". You can also use this property to calculate the number of elements in a jQuery object. They show up as little blocks when they get posted to the page. LEFT: Returns the first character(s) in a text string based on the number of characters specified. and the space characters such as blankspace, tab character and new line character. com Expected Output: The characters of the string in reverse are : m o c. C program to extract the substring from a given string ; What is Dynamic Arrays in C ; c program to delete a substring from a text ; C Program swapping of elements of two arrays ; C Program finding of addresses of an array and its elements ; C program to implement binary search. Java program to input number of boxes to be packed and display the break-up of the cartons used in descending order of capacity. And then, it will divide the given number into individual digits and count those individual digits using While Loop. To do this, you are allowed to delete zero or more characters in the string. In this tutorial, you will learn how to get middle character from the word. " dmh2000's point is that if you have a null character embedded in the middle of an array of characters [i]and you are considering (e. , default), S = single-8-bit-byte characters, b = 16-bit bigendian, l = 16-bit littleendian, B = 32-bit bigendian, L = 32-bit littleendian. Here are some of the most common ones. Strings: A single character is useful when parsing text, one character at a time. Accessing characters in strings by index in Python. A humble request Our website is made possible by displaying online advertisements to our visitors. But it would be easier to use the split() method to return a list of strings, one for each line in the original string, and then add the star to the front of each string in the list. Here is an example of getting the middle letter of the word entered by the user using Java. Example - C Program - Reverse String in place (swapping characters) Reverse a string in place means swapping characters at the beginning and the end of the string and then move towards the middle of the string. ” (terrific). What values do you expect in your character field? What version of SAP are you on? If the character field is not completely filled in, one way that I can think of is to do a right shift and move using offset and length. C++ program to store student details using class; C++ program to print the ASCII values of all characters of a string; C++ program to print values at odd and even index of an array; C example program to add numbers to an array; Different ways in Python to find the square of a number; Python program to print list elements in different ways. Help printing the middle character of an odd length string. This string is actually a one-dimensional array of characters which is terminated by a null character '\0'. char arr[] = {'c','o','d','e','\0'};. We print the positions. data: xc(10) type c, xr(3) type c shift xc right deleting trailing space. But in my case, any characters can appear in my input string, and I only want to keep the characters that I want (without messing up the order of course). Collection of codes on C programming, Flowcharts, JAVA programming, C++ programming, HTML, CSS, Java Script and Network Simulator 2. The traditional method for handling character strings in C is to use an array of characters. In this article we will discuss about how to get middle character of a string in SQL. Create an array of fixed size (maximum capacity), lets say 10. And now you need to find the 3rd occurrence or position of Character "c" from the text string in Cell A1. This program will remove consecutive repeated character from the string in C. This program allows the user to enter a string (or character array). This is the easiest way to learn this function, as it will return an integer that compares the length of the two strings.