How to remove all grammar from a string in Java -


hello trying edit code in order remove grammar. hope in order make can input string area.

public static void main(string[] args) {     // string list      string foxes = "the,quick,brown,fox,jumped,over,the,lazy,dog.";     system.out.println(" here string unedited" + foxes);     string lowercase = foxes.tolowercase();     system.out.println(" here string (no caps): " + lowercase); 

please let me know code should use in order make code remove grammar. thank in advance. :)

see http://www.tutorialspoint.com/java/java_string_replaceall.htm

you want remove punctuation string. easiest way use regular expression find punctuation , replace matches nothing.

string nopunctuation = foxes.replaceall("[\.,:;'\"!\?]", ""); 

simply include each symbol want replaced inside regular expression set , don't forget escape special characters!


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

android - CoordinatorLayout, FAB and container layout conflict -