Creating a set of characters

This seems simple, but it is really bothering me because it is not working. How do I make a simple set of characters. For example: I would like to make a set called "operators" and i would like it to include '-', '+', '*', '%', etc. I will also have a set of "digits" which would be '0' - '9'.
That way, when analyzing a string, I will be able to pick apart each character and figure out which set it belongs to.
Any help would be greatly appreciated.

Something like this might do it (if I'm reading your question correctly)
class CharacterSet
  public static void main(String args[])
    String operators = "%+-*/";
    String numbers = "0123456789";
    String letters = "abcdefghijklmnopqrstuvwxyz";
    String capitals = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    String test = "A+ 4 u";  
    for(int i = 0; i < test.length(); i++)
      if(operators.indexOf(test.charAt(i)) > -1) System.out.println("operator");
      else if(numbers.indexOf(test.charAt(i)) > -1) System.out.println("number");
      else if(letters.indexOf(test.charAt(i)) > -1) System.out.println("letter");
      else if(capitals.indexOf(test.charAt(i)) > -1) System.out.println("capital");
    System.exit(0);
}

Similar Messages

  • Can PowerShell allow the key F9 to generate a set of characters anytime it is pressed ?

    can a PowerShell scriot be installed that allows the key F9 to generate a set of characters anytime it is pressed ?

    Hi Larry,
    Do you mean it will display a set of characters in powershell form when the key F9 is pressed?
    To create shorcut keys in powershell, and execute pre-existing operation when press the shortcut key, this module may be helpful for you:
    http://pseventing.codeplex.com/releases/view/66587
    And the samples below is for your reference:
    import-module pseventingplus
    # kill all jobs
    register-hotkeyevent "ctrl+shift+j" -action { get-job | stop-job -verbose }
    Refer to:
    Use CTRL + D to exit and CTRL + L to cls in Powershell console
    If there is anything else regarding this issue, please feel free to post back.
    If you have any feedback on our support, please
    click here.
    Best Regards,
    Anna Wang
    TechNet Community Support

  • How to create caracter set on version 5.0 ECC

    I have difficulty (only on version 5.0 and 4.7) to create caracter set with reference(or create it anyhow).
    On version 4.6 there is no problem (I can do that like described in course BC305).
    Transaction "spad"->Full administation-> character set->change-> character
    set-> character set->create using template(or just create)
    How could I do that in version 5.0 ECC?
    I have intention to modify char set afterwards as some character are printed incorrecty on a printer device (Digital LG14)after upgrade.
    This device is defined on unix acess type "L" with a custom made device type using a custom made character set
    9452.
    Otherwise(on other printers) I have no problem with characters using acess type "S" with a device type "I2SWIN"(using character set 1406).
    Do you have any idea(tomorrow I will visit customer facing this problem first time). I plan to try the custom made device type with character set 1406.
    Do you have any idea if I do not succeed?

    Hi Tina,
    See
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/d9/4a963651ea11d189570000e829fbbd/frameset.htm">Maintaining Character Sets</a>
    <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/d9/4a967751ea11d189570000e829fbbd/frameset.htm">Defining Character Sets</a>
    Hope this help!
    Juan
    Please reward with points if helpful

  • Replacing a set of characters from a string in oracle sql query

    I want to replace a set of characters ( ~    !     @    #     $     %     ^     *     /     \     +    :    ;    |     <     >     ?    _  ,) from a STRING in sql
    select 'TESTING ! ABC 123 #'
    FROM DUAL;
    What is the best way to do it? Please provide examples also.

    What is your expected output... The query I posted just removes them, it never replaces them with spaces..your string already has space.. if you want to remove space as well .. try this...
    SELECT TRANSLATE ('TESTING ! ABC 123 #', '-~!@#$%^*/\+:;|<>?_, ', ' ') FROM DUAL;
    Output:
    --TESTINGABC123
    Else post your expected output..
    Cheers,
    Manik.

  • How to create the Set ID for report writer

    Hi
    I am suppose to create the Set id . Please suggest me the t-code etc for creating set id.
    Thanks
    Shiv

    transaction for  creating the set ID GS01
    further, the menu path  in the application menu is
    information system->Ad Hoc Reports ->Report Painter ->Report Writer ->Set
    if helpful, plz assign point as way of thanks

  • Creating a Set  containing instances of another Class, which type?

    Hi All,
    I'm stuck trying to create a set which contains instances of another Class.
    When I created my instance method, it takes an argument which is the instance of another Class.
    It errors as I've used the Class as the type rather than String> or Integer.
    Can someone point my in the right direction?
    WebPageData wpd1 = new WebPageData("this is a sentence for a test", "www.test.com");
    WebPageData wpd2 = new WebPageData("this sentence is shorter", "www.short.com");
    WebPageData wpd3 = new WebPageData("this is very short", "www.very.com");
    Finder f1 = new Finder();
    f1.addsite(wpd1);
    f1.addsite(wpd2);
    f1.addsite(wpd3);
    f1.searchFor("a sentence test");
    Edited by: geedoubleu on Mar 16, 2008 9:03 AM

    The error message is "Semantic error: line 5. Message addsite( WebPageData ) not understood by class'Finder'"
    * Adds the argument of WebPageData instances to to a collection scannedSites.
    public void addSite(WebPageData theWebPage)
    this.scannedSites.add(theWebPage);
    }

  • Sharing A Solution - CREATING A SET OF SUB MENUS ON MAIN MENU IN iDVD

    A recent question I posted got some attention from a number of people about how to create a set of sub menus on the main menu of an iDVD project. Evidently there are a number of us who tried to find a way to do this. I attended an Apple Store iDVD workshop and was fortunate enough to be the only one in attendance. So I had the Mac Genius’s attention for a full hour and he was very helpful. Here’s how to do this in detail. Good luck!
    - Fred
    CREATING A SET OF SUB MENUS ON MAIN MENU IN iDVD
    NOTE: when you import the iMovie file don’t add to the drop zones or add music to the sub menus until you finish this work!
    Go to the map view. Once in map view choose to show the map view as a flow chart moving from left to right – it’s the left selection of the two which appear on the left-hand side of the sizing slider tool that determines how big the map view icons will appear. You will want to set that slider to the minimum size to make it easier to navigate. Select the main menu icon.
    Open the main menu to edit it and select “Scene Selection” and then copy and paste it as many times as you have sub menus. Each sub menu can only hold 6 scenes so if you have 18 scenes you will have 3 sub menus which means you will copy the first one and then past it twice which will give you 3 sets of “Scene Selection” options on the main page.
    After you create the set of “Scene Selections” return to map view. You will now have a copy of each group of sub menus under each sub menu. The entire film will be recreated for each set of “Scene Selections” that you have and you need to edit them out so that you have only one for each sub menu.
    You CANNOT simply delete the groups in front of the one you want to keep. For instance, suppose you have 3 sub menu groups and you are at the first sub menu selection. You cannot simply delete the first two groups in front of the third one – it will delete all of the sub menus after the one you want.
    (REPEAT FROM HERE) Go to the last group of sub menus and select the scenes for the first group of sub menus. In other words go down to the last grouping of sub menus, locate the first sub menu group and choose each scene within the group and delete each one. This will leave you with an empty sub menu. Do this for the next group and any subsequent group up to the last one. Do not delete the last group! This is the group you want at this level.
    Once you have deleted the scenes you can cut and paste the last group of scenes to the first sub menu selection in the group. Once done you can delete the other sub menus groups that come after the first one.
    Once you have the group of scenes moved to the first sub menu selection you need to change the name of the group of scenes. For instance if you are working on group 13-18 you need to change the group name from 1-6 which is what it is currently named.
    Repeat these steps for each successive group moving up from the last one to the top with one change – you will choose to delete the last group from each successive sub menu since you have already saved it in the last group you worked on which is below the one upon which you are now working.
    Once you are at the top group you will then simply be able to delete the other sub menus that appear beyond the first one.

    Nicola,
    The Fact: It's all in the markup and the CSS.
    The Problem:  We are not privy to your markup and CSS and as such cannot help you.
    The Solution: Supply a link to your site, or at the very least, copy and paste your code here
    Gramps

  • Need help in creating value set

    hi frs,
    i have created report with parameter status and registerd in apps.
    i need create valuet set like having values like below
    approve,
    cacel,
    pending,
    close,
    all
    all should contain values like approve,cacel,pending,close
    how to create value set of this type.
    help pls.
    regards
    rajesh

    Hi,
    For my Report i need to pass 2 parameters 1.From Period 2.To Period
    I created value set what ever u telling like and parameter window i given low high.
    This is because data is in varchar.
    I tryed in some other way using $flex$ am getting error while attaching.
    can you pls help me i need urgent.
    If u need any more information i will send u...
    Thanks in Advance.
    Regards,
    Leelakrishna.G

  • Search set of Characters in String in mapping

    Hello All,
    I want to search for a set of characters in a string and I want to do this in mapping.
    Can anyone help me in resolving this?
    Example:-
    String = "SAP PI is an Integration Tool"
    Search = "an Integ"
    OR
    just search for "an Integ" in the String.
    The String length can always change and the position of "an Integ" can also change.
    Please help!
    Thanks for your help and time,
    Abhi
    Edited by: Abhi_1516 on Nov 19, 2009 7:08 PM

    Thanks Sunil, for your quick response.
    I tried using that, but it's returning the index of the first occurrance of the Sub String and not "-1" as you have described.
    I am trying to write an UDF and I am getting syntax error ... where I am doing wrong?
    +int ind = (param2 + 7);+
    String str1 = param1.substring(param2,ind);
    String flag;
    if ( (str1.equals("an Integ")) )
    +     flag = "a";+
    else
    +     flag = "b";+
    return (flag);
    param1 and param2 are input parameter in the UDF.
    THanks for your help,
    Abhi
    Edited by: Abhi_1516 on Nov 19, 2009 7:35 PM

  • Error when create a set of recovery disc . In HP Pavilion G6-2103TU Laptop

    Dear friends.
                  when i create a set of  recovery disc in DVD-R.Error  occur (we are experiencing errors in recovery media  creation.tray again ).  Two  disc already create at 3rd disc  this problem facing.helps me.
    jyoti prakash
    Jyoti prakash

    Phone your local HP Support and tell them about the failure. Sometimes you can get a set sent out free of charge. If not there should only be a small charge. Choose your country here to get the number>>
    Contact HP
    ******Clicking the Thumbs-Up button is a way to say -Thanks!.******
    **Click Accept as Solution on a Reply that solves your issue to help others**

  • Is there no way for me to create a set of recover media for 8.1 if I did one for 8.0 previously?

    I "created a set of recovery media" for my laptop when I'd only had it a few days and it was at Windows 8.0.
    Well, a few days later I was offered to upgrade to 8.1, which I have done, and it looks like I'm stuck with the 8.0 recovery media.  It says "Recovery media was created on 2013-12-22.  You are only allowed to create ONE set of recovery media".
    Had I been aware that I was going to be offered to update to 8.1 would have held off, but now it looks like I'm stuck with old recovery media.
    Is there no way around this?  In the event of a recovery, I really do not have to recover back to 8.0 then go through the upgrade to 8.1 again.
    Any ideas?
    Thank you.
    Thankyou.
    This question was solved.
    View Solution.

    Sure.
    http://windows.microsoft.com/en-us/windows/restore-computer-from-system-image-backup#1TC=windows-7
    ******Clicking the Thumbs-Up button is a way to say -Thanks!.******
    **Click Accept as Solution on a Reply that solves your issue to help others**

  • Export to flickr not creating a set

    I thought that the new Flickr export was supposed to create a set for the album when it exported to Flickr, but when I do the export the photos come thru without being in a set.
    Am I missing something?

    You took the correct first steps (good for you), the next thing to try is to create a new Account and test GB from there.

  • New Format for creating Attribute Sets.

    Hi,
    In SAP CRM webclient ui 7.0 there is a new format for creating Attribute Sets. The format is 'value table'.
    On selecting Format=Value Table the field 'Table' comes up.
    There is a message: Here you can enter a table that contains all the values you want to use. This is particularly useful for attributes with a lot of values or if you want to enter multiple attributes with the same values. The table must be a check table with a search help.
    Do I need to create a table with all the fields in in marketing attribute assignment block with search help on attributes field.
    Can you please guide as to how I should go about this issue.
    Regards,
    John.

    Hi John,
    The Attribute Set of Format type 'Value Table' is for the Mutiple Attribute Sets. These can be either a Single Attribute Set with Multiple values or the Multiple Attribute Sets with One value.
    You can include all such marketing attributes into one table which is a check table with search help. and use this as the Value Table.
    Hope this helps you out!
    Regards
    Veena.

  • Create Document Set with custom Create Only permission set

    Here is the situation. We have a requirement where my customer wants to create document sets, however, document set/document level permissions are required.
    Setup: We created a new permission level called "Create Only". We then give the user Read and Create only permissions. This allows the user to theoretically create the item. We then run a Workflow on create that Replaces the permissions so that
    you are only allowed to view the ones you created along with other security groups based on their choices in the metadata fields.
    This setup works PERFECTLY when using a List or Form Library.
    However, for the life of me I cannot get it to work for Document Sets. If I have the same setup, I get an Access Denied message. However, it still creates the document set.
    What is weird, I've been playing around with custom permission levels and it seems as though the user has to have EDIT permissions at a minimum in order to create the document set. This will not work for me since I dynamically assign permissions to each
    document set based on what they select.
    As a side note, the only tool I have at my disposal is SharePoint Designer 2010.
    Does anyone know if there is an actual requirement to have EDIT permissions when creating a Document Set? Any input would be greatly appreciated.
    Alternatively, is there a way to setup permissions on a library for all NT Authenticated users so that we can give them the necessary permissions to create the Document Set, but still prevent them from see the other items and then the Workflow would set
    the permissions accordingly?
    I believe the more granular the permissions it uses those permissions instead so would this work?  I have not tested this theory yet.

    Hi,
    According to your description, my understanding is that you want to know if there is an actual requirement to have EDIT permissions when creating a Document Set and is there a way to setup permissions on a library for all NT Authenticated users and prevent
    them from seeing items created by others.
    For the first question, per my knowledge, if a user is given the Add Items permission, he/she can create a document set in SharePoint.
    However, there is an error “access denied” after the document set is created. It is due to the user has no permission to access the page which SharePoint will redirect the user to after finishing creating the document set.
    If the user is also given Edit Items permission, there will be no error when he/she create a document set.
    For the second question, I recommend to follow the link below to
    customize item permissions for each document submitted to a document library and remember to give the
    NT Authenticated users contribute permission.
    http://blogs.technet.com/b/spke/archive/2010/04/09/configure-item-level-permissions-for-document-libraries-sharepoint-2010-edition.aspx
    To grant permission to NT Authenticated users, please refer to the link below:
    http://office.microsoft.com/en-in/sharepoint-server-help/what-happened-to-add-all-authenticated-users-HA101805183.aspx
    Best regards.
    Thanks
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Convert set of characters to a word

    experts,
           how to convert a set of characters to a word while displaying .
    ex:
        data  : a type char20.
    a = ' FORM A WORD'.
    write :/ a.
    when i execute the above code , list gets generated.
    when i press the cursor on any charater of a the whole value
    should be get selected and not a single character.
    can it be done.
    thanks in advance.

    use color addition it highlights the word. or else use hotspot on addition it will get the complete word when you select.
        data  : a type char20.
    a = ' FORM A WORD' color 2.
    write :/ a.

Maybe you are looking for

  • Hexadecimal to decimal conversion help needed

    hi all i need to know if there exists a method to convert a hexadecimal number to a decimal number If so please let me know which class to refer As a sample to make it more clear i will be reading a hexadecimal number from a file and want to convert

  • Iphone 4 background stays lit during calls

    My iPhone 4 stays lit during calls and causes battery to run low and inadvertently mute me. I've had my screen replaced by citymac and after doing some research I'm guessing it's the proximity sensor. Is there a setting on my phone to turn off the ba

  • Help - spinning beach ball w/one minute of Leopard install left on G5.

    I just tried installing Leopard (10.5.4) on my G5 single with "archive and install". It worked fine until the end, where I got a message saying that the installation was almost complete - a minute left. After about 10 minutes, I clicked on the "utili

  • HR Renewal FP4 Work feeds batch report

    Hi There, Another one from Feature pack 4. We are using standard work feeds and wanted to schedule background report to generate them. Subscription keys have been assigned to Roles. We have about 8 of these standard workfeeds between ESS and MSS. Now

  • HP ENVY m6 Finger Reader Sensor has stopped working

    The sensor light has stopped and when I go into HP Simple Pass I cannot check the box for the sensor illumination.Not sure how to fix it. Thanks