Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Finding a character in acharacter array at specific index, without using the String class.

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Finding a character in acharacter array at specific index, without using the String class.

    I am working on an assignment where I cannot use the String class. I have to basically create my own String class, with a few basic methods. I am currently working on the part where I have to find the character at index[x] and do not really know how to work my way around this. Any ideas?


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Finding a character in acharacter array at specific index, without using the String class.

    If you are working with an array, you would not use any String class methods.
    find the character at index[x]
    If index[x] is an int value it can be used as the index into another array:
    anArray[anotherArray[x]];  // index into anArray using the value at anotherArray[x]
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 1
    Last Post: March 15th, 2013, 03:04 AM
  2. Obtain string from certain index in a string array
    By MartialLaw in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 16th, 2013, 08:55 PM
  3. [SOLVED] Which sort method to use for a String Array to output the index?
    By DANGEROUSSCION in forum Algorithms & Recursion
    Replies: 11
    Last Post: December 8th, 2012, 10:25 PM
  4. Replies: 1
    Last Post: February 4th, 2010, 04:23 PM
  5. [SOLVED] Using class implicit toString() for array index
    By Quetzalma in forum Java Theory & Questions
    Replies: 2
    Last Post: February 3rd, 2010, 05:04 PM