本文整理汇总了Java中com.helger.commons.string.StringHelper.trimEnd方法的典型用法代码示例。如果您正苦于以下问题:Java StringHelper.trimEnd方法的具体用法?Java StringHelper.trimEnd怎么用?Java StringHelper.trimEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.helger.commons.string.StringHelper
的用法示例。
在下文中一共展示了StringHelper.trimEnd方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
@Override
public String apply (@Nullable final Object aValue)
{
String sValue = getValueAsString (aValue);
// strip prefix and suffix
if (m_sPrefix.length () > 0)
sValue = StringHelper.trimStart (sValue, m_sPrefix);
if (m_sSuffix.length () > 0)
sValue = StringHelper.trimEnd (sValue, m_sSuffix);
return sValue;
}
示例2: getWithoutPEMHeader
import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
/**
* Remove any eventually preceding {@value #BEGIN_CERTIFICATE} and succeeding
* {@value #END_CERTIFICATE} values from the passed certificate string.
* Additionally all whitespaces of the string are removed.
*
* @param sCertificate
* The source certificate string. May be <code>null</code>.
* @return <code>null</code> if the input string is <code>null</code> or
* empty, the stripped down string otherwise.
*/
@Nullable
public static String getWithoutPEMHeader (@Nullable final String sCertificate)
{
if (StringHelper.hasNoText (sCertificate))
return null;
// Remove special begin and end stuff
String sRealCertificate = sCertificate.trim ();
/**
* Handle certain misconfiguration issues. E.g. for 9906:testconsip on
*
* <pre>
* http://b-c073e04afb234f70e74d3444ba3f8eaa.iso6523-actorid-upis.acc.edelivery.tech.ec.europa.eu/iso6523-actorid-upis%3A%3A9906%3Atestconsip/services/busdox-docid-qns%3A%3Aurn%3Aoasis%3Anames%3Aspecification%3Aubl%3Aschema%3Axsd%3AOrder-2%3A%3AOrder%23%23urn%3Awww.cenbii.eu%3Atransaction%3Abiitrns001%3Aver2.0%3Aextended%3Aurn%3Awww.peppol.eu%3Abis%3Apeppol3a%3Aver2.0%3A%3A2.1
* </pre>
*/
sRealCertificate = StringHelper.trimStart (sRealCertificate, BEGIN_CERTIFICATE_INVALID);
sRealCertificate = StringHelper.trimEnd (sRealCertificate, END_CERTIFICATE_INVALID);
// Remove regular PEM headers also
sRealCertificate = StringHelper.trimStart (sRealCertificate, BEGIN_CERTIFICATE);
sRealCertificate = StringHelper.trimEnd (sRealCertificate, END_CERTIFICATE);
// Remove all existing whitespace characters
return StringHelper.getWithoutAnySpaces (sRealCertificate);
}
示例3: getMinifiedCSSFilename
import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
/**
* Get the minified CSS filename from the passed filename. If the passed
* filename is already minified, it is returned as is.
*
* @param sCSSFilename
* The filename to get minified. May not be <code>null</code>.
* @return The minified filename
*/
@Nonnull
public static String getMinifiedCSSFilename (@Nonnull final String sCSSFilename)
{
if (!isCSSFilename (sCSSFilename))
throw new IllegalArgumentException ("Passed file name '" + sCSSFilename + "' is not a CSS file name!");
if (isMinifiedCSSFilename (sCSSFilename))
return sCSSFilename;
return StringHelper.trimEnd (sCSSFilename, CCSS.FILE_EXTENSION_CSS) + CCSS.FILE_EXTENSION_MIN_CSS;
}
示例4: append
import com.helger.commons.string.StringHelper; //导入方法依赖的package包/类
protected static void append (@Nonnull final IJAXBDocumentType e,
@Nonnull final EPhase ePhase,
@Nonnull final StringBuilder aSB,
@Nonnull final String sBuilderClass)
{
final String sType = ClassHelper.getClassLocalName (e.getImplementationClass ());
final String sName = StringHelper.trimEnd (sType, "Type");
final String sBuilderMethodName = Character.toLowerCase (sName.charAt (0)) + sName.substring (1);
switch (ePhase)
{
case READ:
// Builder<T> read ()
aSB.append ("/** Create a reader builder for " +
sName +
".\n" +
"@return The builder and never <code>null</code> */\n");
aSB.append ("@Nonnull public static ")
.append (sBuilderClass)
.append ('<')
.append (sType)
.append ("> ")
.append (sBuilderMethodName)
.append ("(){return ")
.append (sBuilderClass)
.append (".create(")
.append (sType)
.append (".class);}\n");
break;
case WRITE:
// Builder<T> write ()
aSB.append ("/** Create a writer builder for " +
sName +
".\n" +
"@return The builder and never <code>null</code> */\n");
aSB.append ("@Nonnull public static ")
.append (sBuilderClass)
.append ('<')
.append (sType)
.append ("> ")
.append (sBuilderMethodName)
.append ("(){return ")
.append (sBuilderClass)
.append (".create(")
.append (sType)
.append (".class);}\n");
break;
case VALIDATE:
// Builder<T> validate ()
aSB.append ("/** Create a validation builder for " +
sName +
".\n" +
"@return The builder and never <code>null</code> */\n");
aSB.append ("@Nonnull public static ")
.append (sBuilderClass)
.append ('<')
.append (sType)
.append ("> ")
.append (sBuilderMethodName)
.append ("(){return ")
.append (sBuilderClass)
.append (".create(")
.append (sType)
.append (".class);}\n");
break;
}
}