diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1d97ead --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.classpath +.project +.settings/ +target/ +test-output/ \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..9f106e8 --- /dev/null +++ b/pom.xml @@ -0,0 +1,26 @@ + + 4.0.0 + + com.api + apple + 0.0.1-SNAPSHOT + jar + + apple + http://maven.apache.org + + + UTF-8 + + + + + + org.testng + testng + 6.11 + test + + + diff --git a/src/main/java/com/api/apple/StringEx.java b/src/main/java/com/api/apple/StringEx.java new file mode 100644 index 0000000..8e4e2aa --- /dev/null +++ b/src/main/java/com/api/apple/StringEx.java @@ -0,0 +1,36 @@ +package com.api.apple; + +/** + * @author DeepikaJammula + * Program : Given a String and a Character, remove all instances of the Character in the String + * + */ +public class StringEx { + + + //Iterate through the String, one character at a time + public static String removeChar(String str,char c){ + + if(str==null) + return null; + StringBuilder str1= new StringBuilder(); + char[] arr = str.toCharArray(); + for(int i=0;i + + + + + + + + + + \ No newline at end of file