Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
Extremely basic java question
Results 1 to 3 of 3

Thread: Extremely basic java question

  1. #1
    Mentor
    Join Date
    Jul 2001
    Posts
    1,666

    Extremely basic java question

    I am writing a method in which it takes in a string and then assigns it to a variable. There are several limitaions on the string and the only one I don't know to to check is that the string must begin with a capital letter. Is there a method to check the case of a specific letter in a string?
    Cheers
    CP

  2. #2

    Re:Extremely basic java question

    try something like:

    Code:
    if (MyString[0] < 65 && MyString[0] > 97) {
      return false;
    }
    Not sure if it works. If not, try replacing 65 and 97 with 'A' and 'Z'. I never learned Java though, so maybe a Java guy could confirm.

  3. #3
    Mentor
    Join Date
    Jul 2001
    Posts
    1,666

    Re:Extremely basic java question

    Thanks for that, I found a different way to do it. I just tear the string apart into the first character and the rest of the string, make the first character uppercase, then put it back together, works like a charm.

Similar Threads

  1. Really basic question ...
    By jeager in forum Linux - General Topics
    Replies: 5
    Last Post: 03-24-2006, 06:32 PM
  2. Basic GUI question
    By mcdougrs in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 05-19-2003, 11:49 PM
  3. very basic fsck question
    By RedHatNewbie in forum Linux - General Topics
    Replies: 8
    Last Post: 02-14-2003, 11:14 PM
  4. Very basic question about IRC
    By papanohair in forum Linux - General Topics
    Replies: 4
    Last Post: 12-20-2002, 05:04 AM
  5. java question
    By krinkstar in forum Linux - Software, Applications & Programming
    Replies: 6
    Last Post: 07-29-2002, 01:47 PM

Bookmarks

Posting Permissions

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