Results 1 to 6 of 6

Thread: starts with?

  1. #1
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default starts with?

    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

  2. #2
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Use Copy() or StrGet()

    Or, if you have something like

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

  3. #3
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

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


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

  4. #4
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default

    Quote Originally Posted by J_Pizzle View Post
    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

  5. #5
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    SCAR Code:
    function StartsWith(s, what : string) : boolean;
    begin
      result := Copy(s, 1, length(what)) = what;
    end;
    ?
    To get the beginning just do what Naum said.
    SCAR Code:
    if Length(s) > 0 then
      if s[1] = '3' {or whatever} then ...
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  6. #6
    Join Date
    Oct 2008
    Location
    behind you!
    Posts
    1,688
    Mentioned
    2 Post(s)
    Quoted
    40 Post(s)

    Default

    Quote Originally Posted by J_Pizzle View Post
    @ ticky lol
    . Just for laugh .
    Hi

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •