In-built string functions
-
String concatenation
-
Declare strings x, y, z
-
Take input for x, y
-
Choose assignment block and write the code
z = strcat(x,y)
-
-
Substring
-
Declare strings x, y
-
Take input for x
-
Choose assignment block and write the code
y = x.substr(0,3)
-
-
String compare
-
Declare strings x, y and integer z
-
Take input for x, y
-
Choose assignment block and write the code
z = strcmp(x,y)
-
-
String length
-
Declare string x and integer y
-
Take input for x
-
Choose assignment block and write the code
y = strlen(x)
-
-
To Ascii
-
Declare string x and integer y
-
Take input for x
-
Choose assignment block and write the code
y = toAscii(x[0])
-
-
To Char
-
Declare an integer x and character y
-
Take input for x
-
Choose assignment block and write the code
y = toChar(x)
-
-
To lower case
-
Declare strings x, y
-
Take input for x
-
Choose assignment block and write the code
y = toLowerCase(x)
-
-
To upper case
-
Declare strings x, y
-
Take input for x
-
Choose assignment block and write the code
y = toUpperCase(x)
-