SUBSTR
Integers - The "is_int()" function can be used to check if a variable is has an integer for its value. ---- is_int($variable); // Returns true if $variable is an integer - otherwise false ---- Numeric Strings - Numeric strings are strings with numbers (or things that count as numbers) in them. Numeric-string variables are not integer variables. Numeric-string variables are passed on through forms, instead of integer variables - if you were wondering. Check form values using string formats, and not integer formats. The "is_numeric()" function can be used to check if a variable is a string with numbers - and only numbers - in it (except things that add up to be numbers). ---- is_numeric($variable); // Returns true if $variable is a string, and only contains numbers (broadly speaking) - false otherwise ---- Strings - String values are just text, basically. String variables can contain integers, but that does not make it an integer-type variable - it makes it a numeric string variable. The "is_string" function can be used to check if a variable contains the value of a string. ---- is_string($variable); // Returns true if $variable is a string - false otherwise
In php to select a sub string from a string, use the command: string substr ( string string, int start [, int length]);Simple Examples:
Without any function is impossible. So I'll assume you mean any coded function, in which case the predefined function below is your answer.$string = strrev($string);
Methods in the Servlet ContextApart from setting and getting custom attributes used for our application, the context also contains various methods that we can use to retrieve specific information about the application and other aspects. They are:• getAttributeNames() - Returns an Enumeration object containing the attribute names available within this servlet context.• getContext(String uripath) - Returns a ServletContext object that corresponds to a specified URL on the server.• getInitParameter(String name) - Returns a string containing the value of the named context-wide initialization parameter, or null if the parameter does not exist.• getInitParameterNames() - Returns the names of the context's initialization parameters as an Enumeration of string objects, or an empty Enumeration if the context has no initialization parameters.• getMajorVersion() - Returns the major version as an int of the Java Servlet API that this Servlet Container supports.• getMimeType(java.lang.String file) - Returns the MIME type as a string of the specified file, or null if the MIME type is not known.• getMinorVersion() - Returns the minor version as an int of the Servlet API that this Servlet Container supports.• getNamedDispatcher(String name) Returns a RequestDispatcher object that acts as a wrapper for the named servlet.• getRealPath(String path) - Returns a string containing the real path for a given virtual path.• getRequestDispatcher(String path) Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path.• getResource(String path) - Returns a URL to the resource that is mapped to a specified path.• getResourceAsStream(String path) - Returns the resource located at the named path as an InputStream object.• getServerInfo() Returns the name and version as a String of the Servlet Container on which the servlet is running.
PHP provides a function called empty($var), which tests if $var is "empty." Empty has an odd definition, since the function returns true if the variable loosely equates to False. Although a zero-length string would be considered empty, so would the string "0" (among other irrelevant values).To accept the value "0" from a field, use strlen($var). It tests the length of any variable, after casting it to a string. If this function truly equals integer zero (compared with triple-equals), the variable must be empty.
The CHARINDEX function in SQL is used to find the position of a specific character or substring within a string. It returns the starting position of the substring or character within the given string.
Integers - The "is_int()" function can be used to check if a variable is has an integer for its value. ---- is_int($variable); // Returns true if $variable is an integer - otherwise false ---- Numeric Strings - Numeric strings are strings with numbers (or things that count as numbers) in them. Numeric-string variables are not integer variables. Numeric-string variables are passed on through forms, instead of integer variables - if you were wondering. Check form values using string formats, and not integer formats. The "is_numeric()" function can be used to check if a variable is a string with numbers - and only numbers - in it (except things that add up to be numbers). ---- is_numeric($variable); // Returns true if $variable is a string, and only contains numbers (broadly speaking) - false otherwise ---- Strings - String values are just text, basically. String variables can contain integers, but that does not make it an integer-type variable - it makes it a numeric string variable. The "is_string" function can be used to check if a variable contains the value of a string. ---- is_string($variable); // Returns true if $variable is a string - false otherwise
strlen
The charAt function returns the number of occurrences of a specified character in the input string.
String-valued functions return NULL if the length of the result would be greater than the value of the max_allowed_packet system variable. For functions that operate on string positions, the first position is numbered 1. 1,ASCII(str)-Returns the numeric value of the leftmost character of the string str. Returns 0 if str is the empty string. Returns NULL if str is NULL. ASCII() works for characters with numeric values from 0 to 255.1. SELECT ASCII('2′); 2,BIN(N)-Returns a string representation of the binary value of N, where N is a longlong (BIGINT) number. SELECT BIN(12); 3,BIT_LENGTH(str)-Returns the length of the string str in bits.SELECT BIT_LENGTH('text'); 4,CHAR(N,…)-CHAR() interprets the arguments as integers and returns a string consisting of the characters given by the code values of those integers. NULL values are skipped.1.SELECT CHAR(77,121,83,81,'76′);SELECT INSERT('Quadratic', 3, 4, 'What'); 5,INSERT(str,pos,len,newstr)-Returns the string str, with the substring beginning at position pos and len characters long replaced by the string newstr.
Val() function is used in Visual Basic 6.0 to convert a string to a numeric value (such as integer, double etc.) or to extract a numeric value out of a string, as illustrated below.Val function as used to convert a string to a numeric valuefor example, let str be a string,Dim str as stringDim int as integerstr="09090"int=val(str)gives int = 9090also, used to extract the numeric part out of a following string,ie. a=val("98ASR_tyui") would give a=98however,b=val("The89")would give b=0 as there is no numeric value preceding the string.
The LEN function returns the length of the specified string.=LEN(text)text is the string to return the length for.EXAMPLE:=LEN(word) will return the value of 4.
A numeric string.
The toUpperCase() method returns the uppercase equivalent of a string.
...QBASIC program code... name$="Jack" startCharPos%=2 howManyChars%=2 PRINT MID$(name$,startCharPos%,howManyChars%) ...output... ac EXPLANATION The MID$() function allows you to select characters from out of a string. In the above case the string is,... name$="Jack" ...where... J= string position 1 a= string position 2 c= string position 3 k= string position 4 ...thus, if we select MID$(name$,2,2)... ...this code is actually saying...select from the name...the character which begins at position 2 = a/and, extract 2 characters going along from there... = ac.
In php to select a sub string from a string, use the command: string substr ( string string, int start [, int length]);Simple Examples:
ALGORITHM REVERSEINPUT (string)"STRINGLENGTH() would be a function that returns the lenght of the string"FOR (i = STRINGLENGTH(string); i >= 0; i--) BEGINDISPAY (string[i])END FOREND REVERSE