SRL Archive - OSR Help

starts with?


JPHamlett

2010-08-26 16:39:30

Is there a function in simba that will only search the first letter of a sctring such as

3Tardck

it would only look at the 3 not the rest of the letters

and i cant use getnumbers or w/e it is cause

there are some like this that haVE numbers in them

The Ojjam 3

Naum

2010-08-26 16:42:04

Use Copy() or StrGet()

Or, if you have something like

String := 'hi';
String[1] will return the 'h'

Tickyy

2010-08-26 16:43:19

function GetNumbers(Text: string): string;
Returns all numerical chars found in a string.


this might be the thing that you're looking for :).

JPHamlett

2010-08-26 17:10:28

From: J_Pizzle

and i cant use getnumbers or w/e it is cause

there are some like this that haVE numbers in them

The Ojjam 3


@ ticky lol

Sex

2010-08-26 17:56:58

function StartsWith(s, what : string) : boolean;
begin
result := Copy(s, 1, length(what)) = what;
end;
?
To get the beginning just do what Naum said.
if Length(s) > 0 then
if s[1] = '3' {or whatever} then ...

Tickyy

2010-08-28 05:28:40

From: J_Pizzle
@ ticky lol


:D. Just for laugh :).