Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

lowercase string input

UnrealDangerUnrealDanger Member Posts: 9
I was wondering if there was any way to convert input from a string variable so that lowercase letters would become upper case. For example if the input is ao89765 it would be converted to AO89765. My data(a huge amount of it) is all uppercase and the search doeasn't work if the input variable contains lower case letters. Being able to convert it would save me from having double the data I have now. I use Qbasic 7.1 if that means anything. Thanks for your help.

Comments

  • alan_pollockalan_pollock Member Posts: 110
    While I don't have the reference handy at this moment, I believe what you want to use is the UPPER$() function. It converts all lower case letters to upper case in the target string.

    Usage:

    newUppercaseText$ = UPPER$(targetText$)

    and conversely:

    newLowercaseText$ = LOWER$(targetText$)

  • alan_pollockalan_pollock Member Posts: 110
    : Sorry, my error... the function is called UCASE$()
    :
    : Usage:
    :
    : newUppercaseText$ = UCASE$(targetText$)
    :
    : and conversely:
    :
    : newLowercaseText$ = LCASE$(targetText$)
    :
    :

  • UnrealDangerUnrealDanger Member Posts: 9
    Worked perfectly, thanks a lot.
  • detjdetj Member Posts: 16
    [b][red]This message was edited by the detj at 2002-3-23 11:24:33[/red][/b][hr]
    : I was wondering if there was any way to convert input from a string variable so that lowercase letters would become upper case. For example if the input is ao89765 it would be converted to AO89765. My data(a huge amount of it) is all uppercase and the search doeasn't work if the input variable contains lower case letters. Being able to convert it would save me from having double the data I have now. I use Qbasic 7.1 if that means anything. Thanks for your help.
    :

    There is no problem in converting uppercase to lowercase or vice versa, when you are using Qb 7.1. Qbasic provides UCASE$ and LCASE$ functions just to change them.
    for example:

    input "Enter name: ";n$ 'suppose this is the input variable
    n$=UCASE$(n$) 'this would convert everything to capitals
    print n$ 'now you can do anything with n$
    end

    You can modify this source as per your needs.





  • Chris BrownChris Brown USAMember Posts: 4,624 ✭✭

    __ { http://forcoder.org } free ebooks and video tutorials about | Perl, Python, Visual Basic, Visual Basic .NET, C#, JavaScript, R, C++, Delphi, Java, Swift, Assembly, Objective-C, MATLAB, PL/SQL, Go, PHP, Scratch, C, Ruby VBScript, Lisp, Dart, D, Julia, FoxPro, Ada, Apex, LabVIEW, Rust, Kotlin, Awk, Scala, Logo, Lua, ABAP, SAS, Hack, Erlang, Crystal, Bash, Transact-SQL, Alice, ML, COBOL, F#, Fortran, Clojure, Scheme, Prolog | _____

Sign In or Register to comment.