Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Java StringBuilder filter same lines

Set<String> tokens = new HashSet<String>(Arrays.asList(s.split("
")));
StringBuilder resultBuilder = new StringBuilder();

boolean first = true;
for(String token : tokens) {
    if(first) first = false;
    else resultBuilder.append("
")

    resultBuilder.append(token);
}

String result = resultBuilder.toString();
Comment

PREVIOUS NEXT
Code Example
Java :: interact with databse java 
Java :: java read from connection even if 404 
Sql :: sql developer search all packages for text 
Sql :: sql server reseed single table 
Sql :: postgres get size of database 
Sql :: today minus 15 days postgresql 
Sql :: oracle nls_date_format 
Sql :: postgresql create table default value timestamp 
Sql :: psql drop column 
Sql :: sql finding longest and shortest names in a fleld 
Sql :: find duplicates mysql column 
Sql :: mysql group_concat distinct 
Sql :: oracle table privileges 
Sql :: sqlalchemy_database_uri for mysql 
Sql :: too many connections mysql 
Sql :: drop all table postgresql 
Sql :: mysql command line xampp ubuntu 
Sql :: liquibase alter column type / length 
Sql :: mysql copy table with new name 
Sql :: mysql show indexes on table 
Sql :: find table for column name in sql 
Sql :: truncate table mysql 
Sql :: mysql find most common value 
Sql :: update column name and datatype in sql 
Sql :: postgres restart id 
Sql :: convert epoch to date in sql server 
Sql :: get permissions postgre query 
Sql :: mysql get last id 
Sql :: sql find missing values between two tables 
Sql :: postgres get next sequence value 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =