You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done.
# See also a good hint with explanation between like and contains:
# http://windowsitpro.com/blog/powershell-contains
$fullstring = "This is my string";
if ($fullstring -like "*my*")
{
Write-Host "found" -ForegroundColor Green;
}
else
{
Write-Host "nope" -ForegroundColor Red;
}
236
MySQL
Strings
String nach Delimenter zerlegen
-- Not a real solution, but a workaround if you have rights to create a function
-- see: http://blog.fedecarg.com/2009/02/22/mysql-split-string-function/
-- same problem with MSSQL.
CREATE FUNCTION SPLIT_STR(
StringToBeSplitted VARCHAR(255),
delimiter VARCHAR(12),
position INT
)
RETURNS VARCHAR(255)
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(StringToBeSplitted, delimiter, position),
LENGTH(SUBSTRING_INDEX(StringToBeSplitted, delimiter, position -1)) + 1),
delimiter, '');
SELECT SPLIT_STR(string, delimiter, position);
237
MySQL
Strings
String nach einem Teilstring durchsuchen
SELECT
myString
,locate('#',myString,5) AS findPosition -- Result is: 8
,left(myString,locate('#',myString,2)-1) AS ExtractedString -- Result is: abc
,left(myString,locate('#',myString,5)) AS ExtractedString -- Result is: abc#def#
FROM
(
SELECT
'abc#def#ghj' AS myString
) dummyString
//http://us2.php.net/manual/de/function.strtoupper.php
$myString = "my lovely Mr Singing Club";
echo strtoupper($myString);
// MY LOVELY MR SINGING CLUB
//http://php.net/manual/de/function.strtolower.php
echo strtolower($myString);
240
Python
Strings
Text in Großschrift oder Kleinschrift
myString = "my lovely Mr Singing Club"
print myString.upper()
// MY LOVELY MR SINGING CLUB
print myString.lower()
241
T-SQL
Strings
Text in Großschrift oder Kleinschrift
SELECT
'my lovely Mr Singing Club' AS myString
,UPPER('my lovely Mr Singing Club') AS myStringUpper
,LOWER('my lovely Mr Singing Club') AS myStringLower
-- myString: my lovely Mr Singing Club
-- myStringUpper: MY LOVELY MR SINGING CLUB
-- myStringLower: my lovely mr singing club
; Important: You musn't check variables in your own job, it will result in a <PARAMETER>-Error!
Set checkjob=1234
Set checkvar="foo"
; Check if job is not my own
Quit:checkjob=$Job
; Check if Job exists und prompt the content of the varible foo
If $Data(^$Job(checkjob)) W !,$ZUtil(88,2,checkjob,checkvar)
; Prompts the content of the variable foo, maybe it is 'bar' ;-)