本文整理汇总了Java中org.apache.commons.lang.StringUtils.stripStart方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.stripStart方法的具体用法?Java StringUtils.stripStart怎么用?Java StringUtils.stripStart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.lang.StringUtils
的用法示例。
在下文中一共展示了StringUtils.stripStart方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: valStr
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@Override
public String valStr() {
String toTrim = args.get(0).valStr();
if (nullValue = args.get(0).isNullValue())
return null;
String remove = null;
if (getArgCount() == 2) {
remove = args.get(1).valStr();
if (nullValue = args.get(1).isNullValue())
return null;
}
String ret = null;
if (mTrimLeading)
ret = StringUtils.stripStart(toTrim, remove);
if (mTrimTrailing)
ret = StringUtils.stripEnd(toTrim, remove);
return ret;
}
示例2: stripXmlDeclaration
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
private String stripXmlDeclaration(CharSequence sequence) {
String str = sequence.toString();
if (hasXmlDeclaration(str)) {
str = str.substring(str.indexOf("?>") + 2);
str = StringUtils.stripStart(str, null);
}
return str;
}
示例3: testSendModeratedEmail
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
/**
* Test that the mail action is correctly constructed when sending notifications emails about users requesting access to a specific site
* @throws Exception
*/
public void testSendModeratedEmail() throws Exception
{
Map<String, String> properties = buildDefaultProperties();
inviteModeratedSender.sendMail(ENTERPRISE_EMAIL_TEMPLATE_PATH, SendModeratedInviteDelegate.EMAIL_SUBJECT_KEY, properties);
verify(mailAction).setParameterValue(eq(MailActionExecuter.PARAM_FROM), eq(requesterMail));
verify(mailAction).setParameterValue(eq(MailActionExecuter.PARAM_TO_MANY), eq(SiteManagerGroup));
verify(mailAction).setParameterValue(eq(MailActionExecuter.PARAM_SUBJECT), eq(SendModeratedInviteDelegate.EMAIL_SUBJECT_KEY));
verify(mailAction).setParameterValue(eq(MailActionExecuter.PARAM_SUBJECT_PARAMS), eq(new Object[]{fullSiteName}));
verify(mailAction).setParameterValue(eq(MailActionExecuter.PARAM_TEMPLATE), eq(emailTemplateNodeRef));
ArgumentCaptor<Map> modelC = ArgumentCaptor.forClass(Map.class);
verify(mailAction).setParameterValue(eq(MailActionExecuter.PARAM_TEMPLATE_MODEL), (Serializable)modelC.capture());
String pendingInvitesLink = StringUtils.stripStart(MessageFormat.format(InviteModeratedSender.SHARE_PENDING_INVITES_LINK, StringUtils.EMPTY, shortSiteName), "/");
// Check the model
Map model = modelC.getValue();
assertNotNull(model);
assertEquals(false, model.isEmpty());
assertNotNull(model.get("productName"));
assertEquals(model.get("inviteeName"), requesterFirstName + " " + requesterLastName);
assertEquals(model.get("siteName"), fullSiteName);
assertEquals(model.get("sharePendingInvitesLink"), pendingInvitesLink);
}
示例4: getBySignature
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public Collection<? extends PhpNamedElement> getBySignature(String expression, Set<String> visited, int depth, Project project) {
if(expression.startsWith("#K#C")) {
// PhpStorm9: #K#C\Class\Foo.class
if(expression.endsWith(".class")) {
expression = StringUtils.stripStart(expression.substring(4, expression.length() - 6), "\\");
}
}
return PhpIndex.getInstance(project).getClassesByFQN(expression);
}
示例5: getHdfsNodePath
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public static String getHdfsNodePath(String parentNodePath, String nodeName) {
return (StringUtils.stripEnd(parentNodePath, HDFS_PATH_SEPARATOR) +
HDFS_PATH_SEPARATOR +
StringUtils.stripStart(nodeName, HDFS_PATH_SEPARATOR));
}
示例6: getNodePath
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public static String getNodePath(String parentNodePath, String nodeName) {
return (StringUtils.stripEnd(parentNodePath, PATH_SEPARATOR) +
PATH_SEPARATOR +
StringUtils.stripStart(nodeName, PATH_SEPARATOR));
}
示例7: authorize
import org.apache.commons.lang.StringUtils; //导入方法依赖的package包/类
public void authorize(String resource, String operation, String regionName, String key) {
regionName = StringUtils.stripStart(regionName, "/");
authorize(new ResourcePermission(resource, operation, regionName, key));
}