Lab Assignment JAVA
Lab Assignment JAVA
String;
import java.util.;
public class StringTest {
if ( array == array1)
{
System.out.println(The Given string is PalinDrome);
return true;
}
else
{
return false;
}
}
else
{
char[] array = new char[50];
char[] array1 = new char[50];
for(int count = 0; count length2; count++ )
{
str.getChars( 0, (length2-1), array, 0);
}
for(int count = 0; count length2; count++ )
{
str.getChars( length-1, (length2), array1, 0);
}
if ( array == array1)
{
System.out.println(The Given string is PalinDrome);
return true;
}
else
{
return false;
}
}
}
public static void removeDuplicates(String values)
{
int tail = 1;
for (int i = 1; i len; ++i) {
int j;
for (j = 0; j tail; ++j) {
if (str[i] == str[j])
break;
}
if (j == tail) {
str[tail] = str[i];
++tail;
}
}
str[tail] = 0;
}
}