Biferno 1.7 Tabasoft.it

Application: ItaliaScuola Back-Office3
Reference
Admin | Edit | Reference | Cache | Logs
Click on a class name to see the description of that particular class:

Predefined Classes

ansi
array
biferno
boolean
cacheItem
char
classInfo
client
collection
curApp
curFile
curScript
db
double
error
file
folder
header
httpPage
imageUtils
int
long
memberInfo
multipart
object
ref
regexp
request
search
serverInfo
smtp
stackItem
string
time
unix
unsigned
 

Application Classes

Banner
BrowserBar
Ctrl_Form
FCKeditor
Form
GridChartGraph
Histogram
LocalDate
Result
condb
cookie
folderExt
headerExt
httpExt
mysqlFulltext
objHtml
requestExt
tableExport
utils
 

Functions

Functions

string

Method:

Compare

int Compare(string str, boolean caseSense)

Compares two strings

Description:

This method takes as parameters the string to compare to and a boolean value to indicate if the comparison should be case sensitive or not (the default is false). The method returns an integer value, which can be 0 (zero), if the two strings are equal, 1, if the string to be compared is greater, or –1 if the string to be compared is smaller. An example is:

str1 = "a"
str2 = "b"
$str1.Compare(str2) // This instruction prints the value 1
str1 = "sun"
str2 = "Sun"
$str1.Compare(str2) // prints the value 0
$str1.Compare(str2, true) // prints the value -1

Parameters:
str

the string to compare to

caseSense

indicates if the comparison should be case sensitive or not (the default is false)

Returns:

0 (zero), if the two strings are equal, 1, if the string to be compared is greater, or –1 if the string to be compared is smaller

Notes:

Comparing two string means to compare one by one their characters by starting from the first (the leftmost), until either two different characters are found, or the end of one of the two strings is reached.

Two strings are considered equal if they consist of the same characters in the same sequence. If two different characters are found in a corresponding position, the relationship between these two characters determines the relationship between the strings.

A character is considered “less” than another character if it precedes it in the ASCII character table. A string is considered “less” than another if the first different character is “less” than the corresponding character in the other string. If the first characters of the longest string are exactly the same as the shortest string, the longest string is always considered greater. Notice that the result of character comparison for characters with ASCII code greater than 128 can depend on the operating system. These characters can assume different values on different systems.

The simplest method to compare two Biferno strings is to use logical operators. Using logical operators the comparison is case sensitive, i.e. the two strings “sun” and “Sun” are considered different.

See also:

ansi.strcmp

Implementation:
C
 

Return to the string class