Getting one character at a certain position from a string array

Hi, i'm new at learning java, but have strong experience at C++ and asm. How would i get one character at a certain positon from a string array.
for example:
String Phrases[] = {"To be or not to be, that is the question","The Simpsons","The Mole","Terminator three rise of the machines","The matrix"};
that is my string array above.
lets say i wanted to get the first character from the first element of the array which is "T", how would i get this

ok well that didn't work, but i found getChars function can do what i want. One problem, how do i check the contents of char array defined as char Inchar[];

Similar Messages

  • Find files that match with given string, except one character in a fixed position

    Hi,
    I want to find files in a directory with a given string (ss-20140129-process-000*.sdx), where only one character will be mismatched, so have to use wildcard for that character. This means I am looking for filenames where everything needs to be matched except
    one character in position of "*". For the samples given below: 1st 3 files matched with the given string, but last 3 files have not matched, so first 3 files will be counted.
    ss-20140129-process-0001.sdx
    ss-20140129-process-0004.sdx
    ss-20140129-process-0009.sdx
    zx-20140129-process-0001.sdx
    bt-20140129-process-0002.sdx
    zx-20140129-process-0001.sdx
    I can use the command like (GCI -path $folder -filter ss-20140129-process-000?.sdx), BUT problem is i am building a string for the filter (code given below), where i DO NOT know how to use "?" within the string to make a character exception.
    Code:
    $datevalue = [datetime]::parseexact($trandate,"MMddyy",$null)
    $yyyymmdd = $datevalue.tostring('yyyyMMdd')
    $FileToCheck = ("ss-"+$yyyymmdd+"-process-000?.sdx")
    GCI -path $folder -filter $FileToCheck
    But it's definitely NOT working for syntax problem.
    Any help?

    I don't think it's a syntax issue in the filter.  This works fine for me:
    $yyyymmdd = '20140129'
    $FileToCheck = ("ss-"+$yyyymmdd+"-process-000?.sdx")
    Get-ChildItem -Path . -Filter $FileToCheck
    <#
    Output:
    Directory: C:\source\Temp\sdxtext
    Mode LastWriteTime Length Name
    -a--- 1/30/2014 10:16 AM 0 ss-20140129-process-0001.sdx
    -a--- 1/30/2014 10:16 AM 0 ss-20140129-process-0004.sdx
    -a--- 1/30/2014 10:16 AM 0 ss-20140129-process-0009.sdx
    #>
    You can try adding some debug output right before the call to Get-ChildItem. Check the values of $Folder and $FileToCheck, make sure they're correct. You can also fiddle with the values and call Get-ChildItem manually until it works, which would then tell you
    how the code needs to be changed.

  • Can I sync certain itmes from one itunes account and certain items from another itunes account on the same ipad?

    I was wondering if an individual would be able to sync certain items from one itunes account and and items from a different itunes account to the same ipad?

    You move the song files to /Users/Shared/ and then into iTunes from the other Mac OS X user account.
    If you want to change the iTunes Store account associated with them, you need to redownload them from that account.
    (60812)

  • How to get one character at a specified index and put it in a mutablestring

    I am new in cocoa programing and i am stock.
    I am trying to get a character in a NSString and i want to put it in a NSMutableString with the command appendString.
    For now it's not working. I try with different approach but i didn't find the right way to do that. It's probably very simple but i just don't see hit.
    I try with characterAtIndex and with getCharater. And now i am thinking to use charcaterRange but i don't know how to articulate an NSRange.
    Maybe somebody could show an example of of what i have to do to do that.
    I put this <<<<<<<<<<<<<<<< to show where in my code it's not working
    Thanks a lot for your help it's very appreciate.
    *The header:*
    #import <Cocoa/Cocoa.h>
    @interface Controleur : NSObject
    NSMutableArray *touche_presser;
    NSMutableArray *typedevariable;
    NSMutableString *formule;
    int calculencours;
    int i;
    int n;
    IBOutlet NSTextField *affichagede_laformule;
    IBOutlet NSTextField *informationdesupport;
    -(void) awakeFromNib;
    -(IBAction)touche_clear:(id)sender;
    -(IBAction)touche_0:(id)sender;
    -(IBAction)touche_1:(id)sender;
    -(IBAction)touche_2:(id)sender;
    -(IBAction)touche_3:(id)sender;
    -(IBAction)touche_4:(id)sender;
    -(IBAction)touche_5:(id)sender;
    -(IBAction)touche_6:(id)sender;
    -(IBAction)touche_7:(id)sender;
    -(IBAction)touche_8:(id)sender;
    -(IBAction)touche_9:(id)sender;
    -(IBAction)touche_plus:(id)sender;
    -(IBAction)touche_moins:(id)sender;
    -(IBAction)touche_multiplier:(id)sender;
    -(IBAction)touche_diviser:(id)sender;
    -(IBAction)touche_egale:(id)sender;
    -(NSString *) constructionde_laformule;
    -(NSNumber *) analysed_unerafale: (NSString *) elementd_uneformule;
    @end
    *The Methode:*
    -(NSNumber *) analysed_unerafale: (NSString *) elementd_uneformule;
    // Ici, j'analyse une partie de la formule et retourne le résultat (nsnumber)
    // dans la variable resultatde_l_analyse_de_larafale
    int ia;
    int nombrede_caractere_dans_element_de_laformule;
    NSNumber *resultat_actuel;
    resultat_actuel = [[NSNumber alloc]initWithInt:0];
    NSNumber *resultat_precedant;
    resultat_precedant = [[NSNumber alloc]initWithInt:0];
    NSNumber *resultatde_l_analyse_de_larafale;
    resultatde_l_analyse_de_larafale = [[NSNumber alloc]init];
    NSMutableString *caractere_x;
    caractere_x = [[NSMutableString alloc]init];
    NSMutableString *operateur;
    operateur = [[NSMutableString alloc]init];
    nombrede_caractere_dans_element_de_laformule = [elementd_uneformule length];
    ia = 0;
    for (n=1; n <= nombrede_caractere_dans_element_de_laformule; n = n+1)
    ia++;
    char y = [elementd_uneformule characterAtIndex:ia]; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< here
    NSString *x = [[NSString alloc] initWithUTF8String: y]; //[NSString stringWithFormat:@"%@", y]; <<<<<<<<<<<<< and here
    [caractere_x setString:@""];
    [caractere_x appendString:x];
    return resultatde_l_analyse_de_larafale;
    @end
    P.S.
    Excuse my bad english i am french speaking

    I also couldn't figure out what your code is doing, but hope this sample code will help:
    NSString *firstString = @"Canada";
    NSMutableString *secondString = [NSMutableString stringWithCapacity:10];
    int index = random() % [firstString length];
    // get a substring of length 1 at the index position of firstString
    NSString *oneCharString = [firstString substringWithRange:NSMakeRange(index, 1)];
    // append the single-character substring to secondString:
    [secondString appendString:oneCharString];
    NSLog(@"firstString=%@ index=%d secondString=%@", firstString, index, secondString);
    I was testing the above when your first reply was posted. It uses the same method Et suggested, but I didn't want to just throw it away.

  • Getting special character while saving adobe form from portal

    Hi All,
    I am getting Special character while saving adobe form. I am using webdynpro java application, in which I am using download file UI element.We are facing this issue after support packs were implemented in staging system.
    Kindly advise.
    Regards
    Shashwat

    Hi,
    We have ABAP system as backend system seperately and Single sign on is configured.
    when we access the portal with domain name line http://hostname.domain/52000/irj/portal, we are able to access the adobe form which is develope on abap system without any issue.
    but our issue started when we are trying to access portal only with hostname as http://hostname:52000/irj/portal
    we are able to login to portal but when we are trying to open the adobe form we are getting error
    No switch to HTTPS occurred, so it is not secure to send a password
    Since you have configured SSL, I assume that this configuration is done with fully qualified hotsname. Hence the certificate is generated based on this hostname.
    Now when you access your portal without typing fully qualified hostname, system is unable to locate a relevant certificate. Hence it lands up with a message "No switch to HTTPS occurred, so it is not secure to send a password"
    Hope this answers your query
    Regards,
    Deepak Kori

  • Find a value and the position from the string.

    Hi All,
    Actually I have one table called test and it got 2 columns in it one is number and the other one is varchar2. now I need to find a particular value from a string and also the position of first position character of that searched value. For example, I need to search “Small” from the string “This is the small value” and also the position of that letter “S”.
    The result should be ----
    Value Position
    Small 14
    hare krishna
    Alok

    use substr(), instr() like this:
    with
      test as
          select 1 as num, 'This is the small value' as str from dual union all
          select 2 as num, 'This is the very-very small_value' as str from dual
    select num, str,
           substr(substr(str, instr(str, 'small', 1, 1)), 1,
                              nvl(nullif(instr(substr(str, instr(str, 'small', 1, 1)), ' ', 1, 1),0),
                                        length(str)) - 1) as value,
           instr(str, 'small', 1, 1) as position
      from test
    Query finished, retrieving results...
    NUM                  STR                     VALUE      POSITION
      1   This is the small value             small               13
      2   This is the very-very small_value   small_value         23
    2 row(s) retrieved

  • How can I replace a certain position of a String?

    How can I do this?
    I have this string: "Hello World"
    Now I want it to have: "Hello Warld"
    I already know the position of the char to be replaced.

    Try StringBuilder/StringBuffer. You can set a character at a certain location.

  • Getting a character at a given index in a String and returing as a String

    Hello,
    How do I simply grab one character in a string and return it as a string? I saw the substring() method but it does not like when I invoke:
    String test = "abcd";
    test = test.substring(0,0);
    **Above produces a runetime error. ***I need something that does this:
    String test = "abcd"
    test.needtodo(0) returns String "a".
    test.needtodo(1) returns String "b".
    ETC.
    ---- Thanks for the help.

    Ok I used Kaj's method, but what I am trying to do still inst working properly. Here is what I am trying to do:
    public String stringToBinaryStringWithLeadingZeroz(String input) {
         String binaryString="";
         int sizeOf = input.length();
         for(int i=0; i < sizeOf; i++)
              int intRepresentation = Integer.parseInt(String.valueOf(input.charAt(i)), 16);
              binaryString += Integer.toBinaryString(intRepresentation);
         return binaryString;
    }I am trying to take in a String that is Hex and return a string that is binary with leading zeros.
    So if the input is: stringToBinaryStringWithLeadingZeroz("3");
    It should be returning 0011 but its still only returning 11. It shouldnt be returning 0011 though. I am passing each character indivudally into the method toBinaryString() which just returns the result and appends onto the result.
    ** SCRATCHING MY HEAD **

  • How to dynamically create a JSF dataTable from a String[][] array

    Hi, I�m developing an application that uses columns, rows and data instead of any other attributes, so I got from a database Resultset a String[] array with the rows headers, other String[] array with the columns headers, and a String[][] array with the information between every row[] and column[] header al this String arrays depend on a method that receives the group title as a parameter so they are dynamically created, anyway I can display this information in a jsp page but I don�t know how to display this information in a JSF dataTable.
    Does anybody knows how I could do this? and which is the proper way to create a dynamically rows and columns dataTable?

    Hi, I�m developing an application that uses columns, rows and data instead of any other attributes, so I got from a database Resultset a String[] array with the rows headers, other String[] array with the columns headers, and a String[][] array with the information between every row[] and column[] header al this String arrays depend on a method that receives the group title as a parameter so they are dynamically created, anyway I can display this information in a jsp page but I don�t know how to display this information in a JSF dataTable.
    Does anybody knows how I could do this? and which is the proper way to create a dynamically rows and columns dataTable?

  • How to Get One MQ Message at a time from MQ Queue

    Hi,
    Before posting my query here is the configuration I am using:_
    Weblogic Server 10.3.3
    Soa Server 11.1.1.3.0
    Oracle JDeveloper 11.1.1.3.0
    Till now I have done the following things:_
    1) created an MQ Queue
    2) Producing MQ Messages in the Queue with the help of an Asynchronous BPEL process.
    I can see the message put in the Queue:
    What is my requirement?_
    1) I want to read (Get) only one of the above created MQ Messages in the main BPEL process(Synchronous), then needs to process it
    And based on my Business condition I have to write that message in the Database.
    After successful completion of this instance only my main process should go to consume the next message in the MQ queue.
    What is the problem I am facing?_
    1) The main BPEL process is not reading one message at a time. I.e. if there are 10 messages in the queue, then as soon as the main bpel process gets deployed, 10 instances created automatically, all in running status and Queue gets empty
    2) And if I explicitly test the process, the processes always go in running mode. I.e. Waiting for the messages at the receive activity (this receive is attached to the MQ adapter through operation Get in the main BPEl process)
    I just want to know how I can read the MQ messages one by one, though there may be n number of messages in the MQ queue
    And only after the completion of the first instance (of Reading First MQ message from queue) it would go to initiate the next instance and so on
    Would anyone please help me in this issue?
    Thanks
    Sunil

    Is the MQ Queue local or remote?

  • HT201240 I don't have the disk to do this, where can I get one? I bought my mac from a shop in botany, this was an ex lease mac etc.... Can you please help?

    Hi, I don't have the start up disk for my mac, and am not able to login how can I reset my password? Mac was purchased as a ex lease from a PCM shop in botany.... Cheers

     
    Replacement System Discs can be obtained from Apple's Customer Support - US (800) 767-2775 for a nominal fee. You'll need to have the model and serial number of your Mac available. 
    If you're not in the US, you may need to go through the regional Apple Store that serves your location to find the contact number - http://store.apple.com/Catalog/US/Images/intlstoreroutingpage.html

  • Creating object with names from a String Array

    Hi all,
    This might be a stupid question .. I have the following method:
         public OptionInputPanel(Option newO, String [] parameter){
              super(new BorderLayout());
              o = newO;
              for (int i = 0; i < parameter.length; i++){
                   testB = BorderFactory.createTitledBorder(parameter);
                   JFormattedTextField parameter[i] = new JFormattedTextField(); // problem
    as you can see I would like to name my text fields with the strings that I have in the parameters array so that I can get their values later on. How can I do it?
    Thanks for help
    Stan

                   JFormattedTextField parameter[i] = new JFormattedTextField(); // problemYou are declare an array of size i, and assigning a single JFormattedTextField to it.
         public OptionInputPanel(Option newO, String [] parameter){
              super(new BorderLayout());
              o = newO;
              JFormattedTextField params[ i ] = new JFormattedTextField();
              for (int i = 0; i < parameter.length; i++){
                   testB = BorderFactory.createTitledBorder(parameter[ i ]);
                   param[ i ] = new JFormattedTextField(parameter[ i ]);
    Resources for Beginners
    Sun's basic Java tutorial
    Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's Thinking in Java (Available online.)
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java. This one has been getting a lot of very positive comments lately.

  • How to populate items in selectOneListBox from a string array

    Hi
    I have got a string array result[] .Now i wish to display the array items in selectOneListBox.Please help me?

    Alance wrote:
    Hi
    I have got a string array result[] .Now i wish to display the array items in selectOneListBox.Please help me?I can only guess what your selectOneListBox is but if it is JComboBox - have you ever thought about reading the API ?
    [http://java.sun.com/javase/6/docs/api/javax/swing/JComboBox.html]
    There's a wonderful constructor which probably does what you are looking for.

  • While generating reports in Oracle BI Publisher in pdf format, the generated pdf reports have hindi  इ matra displaced by one character. For example, रिपोर्ट is printed as रपेिोरट.  Word file generated of the same report have correct hindi इ  matra positi

    While generating reports in Oracle BI Publisher in pdf format, the generated pdf reports have hindi  इ matra displaced by one character. For example, रिपोर्ट is printed as रपेिोरट.  Word file generated of the same report have correct hindi इ  matra position and also pdf generated from this word file also contains the same.

  • How do I get the arrow keys to move one character at a time in the address bar or search box?

    I can no longer get the arrow keys to advance or retard "one character at a time" in the address bar, the search box, or on any form in Firefox. This feature works in other browsers without a problem. The "Home" and "End" keys do not work either. How do I fix this behavior?

    How do I configure the AX to connect to the hub's wireless network? It will only scan one base station Airport Express at a time in the Airport Utility. I think what I am trying to do is use the hub as a router to the two AX's. Is there a specific way to set this up?
    To set up the AX to join a wireless network as a "Wireless Client," using the AirPort Utility, either connect to the AX's wireless network or temporarily connect your computer directly (using an Ethernet cable) to the Ethernet port of the AX, and then, try these settings:
    Launch the AirPort Utility.
    Select the AX.
    If not already connected to the AX's wireless network, go ahead and switch to it when prompted.
    AirPort Utility > Select the AX > Manual Setup > AirPort > Wireless
    Wireless Mode: Join a wireless network
    Network Name: <type in the network name/SSID of the wireless network that you want to join or select it from the pop-up menu>
    Wireless Security: None OR, if you are using security on your wireless network:
    Wireless Security: <Select the appropriate level of security for the existing wireless network: WPA/WPA2 Personal | WPA2 Personal>
    Password: <enter your wireless network security password>
    Verify Password: <re-enter the same security password>
    Click Update to write the new settings to the AX.

Maybe you are looking for

  • Can't run Net8 Configuration Assistant & DBCA

    Dear Friends, I have the following problems - after installation of Oracle 8i EE for Linux i have 2 components that fails: - Net8 Configuration Assistan; - Oracle Database Configuration Assistant. The error is the same (JAVA - class not found): After

  • Why am I suddenly getting error messages when updating the vault?

    Hi, I would greatly appreciate any advice anyone here can offer of how to correct a problem that started recently. I've updated the vault for Aperture successfully many times before, but now, when I attempt to update the vault I've started receiving

  • Hyperion 7.0 Slow Performance

    We are having very slow performance with Hyperion Report 7.0 running batches and reports. Has anyone else experienced this and had any success improving the performance?

  • Enable Flash Player in Mozilla Fire Fox without Admin Rights

    Hi, I am from australia i have a question how do i enable flash player in my system without admin rights. at present there is no access to install software to my system. please help thanks in advance Regards John Burns

  • Some quick help needed with certificates and split brain dns.

    I run exch 2010 and have one cas server(srv03).  I have split brain dns configured and working in my system.  I got a new certificate this year because of the new regulations that won't allow .internal names in the san portion of an ssl cert.  I have