Reply from xtrycatchx on May 12 at 11:53 AM use equalsIgnoreCase()
| | | ---------------Original Message--------------- From: karthikrajun Sent: Saturday, May 12, 2012 11:33 AM Subject: How to Compare Single Character in 2 Arrays in Java Hi, thank you for your response. Here is the description of my code the main purpose of this code is, 1) This program will read two names from keyboard into an array. 2) Now it will compare each and every character between two arrays, and repalces with an empty space. 3) At final it will count the remaining characters in both arrays, I completed in c++ but in java/jsp I am not getting issues char a[20],b[20]; int size,size1,i,j; cout<<"enter first,second name"; cin.getline(a,20); cin.getline(b,20); size=strlen(a); size1=strlen(b); for(i=0;i<size;i++) { for(j=0;j<size1;j++) { if(a==b[j]){ a=' '; b[j]=' '; }}} output enter two names karthik raju here common characters are "a" and "r" so it will replaces with empty space o/p kthik ju, there fore count is 7. Can you Please send the java/jsp code with these requirements. Regards, Karthik | | Reply to this email to post your response. __.____._ | _.____.__ |
No comments:
Post a Comment