1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

GM:S 1.4 Check the case of a letter? (SOLVED)

Discussion in 'Programming' started by Fixer90, Nov 19, 2017.

  1. Fixer90

    Fixer90 Member

    Joined:
    Nov 17, 2016
    Posts:
    145
    Is there a way to check the case of a letter (whether or not it's a capital letter), returning either true or false (or something similar)?
     
  2. TheouAegis

    TheouAegis Member

    Joined:
    Jul 3, 2016
    Posts:
    7,437
    if chr(letter) > 96 return true;

    Although that will also return true for some other things....

    if chr(letter) > 96 and chr(letter) < 123 return true;
     
    Bentley and Fixer90 like this.
  3. obscene

    obscene Member

    Joined:
    Jun 21, 2016
    Posts:
    2,511
    Also you can lowercase strings and compare if you need to check more than one character...

    var lower=string_lower(string);
    if string==lower { stuff }
     
    Bentley and TheouAegis like this.
  4. TheouAegis

    TheouAegis Member

    Joined:
    Jul 3, 2016
    Posts:
    7,437
    [​IMG]

    The numbers under DEC are the chr() returns.
     
    Bentley likes this.

Share This Page