List of usage examples for org.apache.commons.lang StringUtils chop
public static String chop(String str)
Remove the last character from a String.
From source file:org.yes.cart.web.page.component.customer.order.CustomerOrderPanel.java
/** * Get sku names in order./*from www. j ava 2s .co m*/ * * @param order given order * @return comma separated sku names. */ private String getItemsList(final CustomerOrder order) { final StringBuilder builder = new StringBuilder(); for (CustomerOrderDet det : order.getOrderDetail()) { builder.append(det.getProductName()); builder.append('('); builder.append(det.getProductSkuCode()); builder.append("), "); } return StringUtils.chop(StringUtils.chop(builder.toString())); }
From source file:ubic.gemma.apps.ArrayDesignSequenceAssociationCli.java
@SuppressWarnings("static-access") @Override/*from www .j a v a 2 s . co m*/ protected void buildOptions() { super.buildOptions(); Option fileOption = OptionBuilder.hasArg().withArgName("Input sequence file") .withDescription("Path to file (FASTA)").withLongOpt("file").create('f'); addOption(fileOption); Option sequenceIdentifierOption = OptionBuilder.hasArg().withArgName("Input identifier file") .withDescription("Path to file (two columns with probe ids and sequence accessions)") .withLongOpt("ids").create('i'); addOption(sequenceIdentifierOption); StringBuffer buf = new StringBuffer(); for (String lit : SequenceType.literals()) { buf.append(lit + "\n"); } String seqtypes = buf.toString(); seqtypes = StringUtils.chop(seqtypes); Option sequenceTypeOption = OptionBuilder.hasArg().isRequired().withArgName("Sequence type") .withDescription(seqtypes).withLongOpt("type").create('y'); addOption(sequenceTypeOption); addOption(OptionBuilder.hasArg().withArgName("accession").withDescription("A single accession to update") .withLongOpt("sequence").create('s')); Option forceOption = OptionBuilder.withArgName("Force overwriting of existing sequences") .withLongOpt("force") .withDescription("If biosequences are encountered that already have sequences filled in, " + "they will be overwritten; default is to leave them.") .create("force"); addOption(forceOption); Option taxonOption = OptionBuilder.hasArg().withArgName("taxon") .withDescription( "Taxon common name (e.g., human) for sequences (only required if array design is 'naive')") .create('t'); addOption(taxonOption); }