19.11.2017, 17:21
For example second character of string[] = "dog" is "o"
Is there function for this?
Is there function for this?
For example second character of string[] = "dog" is "o"
Is there function for this? |
new String[8];//With this variable we will store the letter or letters that you want to extract.
strmid(String, "Extract 'HELLO' without the !!!!: HELLO!!!!", 34, 39); //string contains "HELLO"
//strimd(param1, param2, param3, param4);
//param 1 The string to store the extracted characters in.
//param 2 The string from which to extract characters.
//param 3 The position of the first character or the part where you want to start extracting the text.
//param 4 The position of the last character or the final part where you want to start extracting the text.
printf("%s", String); //We print to screen to check what works.
//Result: HELLO
new animalname[4] = "dog"; if(strtolower(animalname)[1] == 'o') { // code here }
Код:
new animalname = "dog"; if(strtolower(animalname)[1] == 'o') { // code here } |
if(tolower(string[1]) == 'o') { // Stuff.. }