Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    15
    Views
    1,081

    [SOLVED] Re: Enforcing a format on a string?

    Glad you got it working.
    regex will probably also do what you want and I'm sure you will learn about regex later.
  2. Replies
    15
    Views
    1,081

    [SOLVED] Re: Enforcing a format on a string?

    Read the rest of post#12

    Note:
    = is the assignment operator
    == is the equality tester
  3. Replies
    15
    Views
    1,081

    [SOLVED] Re: Enforcing a format on a string?

    Please copy the full text of the error messages and paste it here.

    Looks like you should read the API doc for the classes and methods you are using to see how to code them.


    char values can be...
  4. Replies
    15
    Views
    1,081

    [SOLVED] Re: Enforcing a format on a string?

    Ok, then a single if statement something like this:

    if(firstCharIsOk && secondCharIsOk && continue with expressions to test each char to last char) {
    // String is OK
    }else {
    // String has...
  5. Replies
    15
    Views
    1,081

    [SOLVED] Re: Enforcing a format on a string?

    Does the specific char that is wrong need to be reported
    or is it enough to say there is an error in the String?

    How many if statements to use depends on the response to the above.
  6. Replies
    15
    Views
    1,081

    [SOLVED] Re: Enforcing a format on a string?

    The code would look at each section of the String differently: 3 digits, one - and one letter
    The validation might be done in a single if statement if the specific wrong char didn't need to be...
  7. Replies
    15
    Views
    1,081

    [SOLVED] Re: Enforcing a format on a string?

    Are you looking for a regex
    or can you code a loop or if to do the validation char by char?
Results 1 to 7 of 7