public java.lang.String replaceFirst(java.lang.String s, char oldSub, char newSub) { return StringUtil.replaceFirst(s, oldSub, newSub); }
public java.lang.String replaceFirst(java.lang.String s, java.lang.String oldSub, java.lang.String newSub) { return StringUtil.replaceFirst(s, oldSub, newSub); }
public java.lang.String replaceFirst(java.lang.String s, java.lang.String oldSub, java.lang.String newSub, int fromIndex) { return StringUtil.replaceFirst(s, oldSub, newSub, fromIndex); }
public java.lang.String replaceFirst(java.lang.String s, java.lang.String[] oldSubs, java.lang.String[] newSubs) { return StringUtil.replaceFirst(s, oldSubs, newSubs); }
public java.lang.String replaceFirst(java.lang.String s, char oldSub, java.lang.String newSub) { return StringUtil.replaceFirst(s, oldSub, newSub); }
/** * Replaces the first occurrence of the string with the new string. * * @param s the original string * @param oldSub the string whose first occurrence in the original string * is to be searched for and replaced * @param newSub the string with which to replace the first occurrence of * the <code>oldSub</code> string * @return a string representing the original string except with the first * occurrence of the string <code>oldSub</code> replaced with the * string <code>newSub</code> */ public static String replaceFirst(String s, String oldSub, String newSub) { return replaceFirst(s, oldSub, newSub, 0); }
/** * Replaces the first occurrences of the elements of the string array with * the corresponding elements of the new string array. * * @param s the original string * @param oldSubs the strings whose first occurrences are to be searched * for and replaced in the original string * @param newSubs the strings with which to replace the first occurrences * of the <code>oldSubs</code> strings * @return a string representing the original string with the first * occurrences of the <code>oldSubs</code> strings replaced with the * corresponding <code>newSubs</code> strings, or <code>null</code> * if the original string, the <code>oldSubs</code> array, or the * <code>newSubs</code> is <code>null</code> */ public static String replaceFirst( String s, String[] oldSubs, String[] newSubs) { if ((s == null) || (oldSubs == null) || (newSubs == null)) { return null; } if (oldSubs.length != newSubs.length) { return s; } for (int i = 0; i < oldSubs.length; i++) { s = replaceFirst(s, oldSubs[i], newSubs[i]); } return s; }
/** * Replaces the first occurrence of the character with the new string. * * @param s the original string * @param oldSub the character whose first occurrence in the original * string is to be searched for and replaced * @param newSub the string with which to replace the first occurrence of * the <code>oldSub</code> character * @return a string representing the original string except with the first * occurrence of the character <code>oldSub</code> replaced with the * string <code>newSub</code> */ public static String replaceFirst(String s, char oldSub, String newSub) { if ((s == null) || (newSub == null)) { return null; } return replaceFirst(s, String.valueOf(oldSub), newSub); }
/** * Replaces the first occurrence of the character with the new character. * * @param s the original string * @param oldSub the character whose first occurrence in the original * string is to be searched for and replaced * @param newSub the character with which to replace the first occurrence * of the <code>oldSub</code> character * @return a string representing the original string except with the first * occurrence of the character <code>oldSub</code> replaced with the * character <code>newSub</code> */ public static String replaceFirst(String s, char oldSub, char newSub) { if (s == null) { return null; } return replaceFirst(s, String.valueOf(oldSub), String.valueOf(newSub)); }
@Override protected String getLink( UserNotificationEvent userNotificationEvent, ServiceContext serviceContext) throws Exception { JSONObject jsonObject = JSONFactoryUtil.createJSONObject( userNotificationEvent.getPayload()); String entryURL = jsonObject.getString("entryURL"); if (Validator.isNull(entryURL)) { return StringPool.BLANK; } String entryURLDomain = HttpUtil.getDomain(entryURL); String portalURL = serviceContext.getPortalURL(); String portalURLDomain = HttpUtil.getDomain(portalURL); if (!entryURLDomain.equals(portalURLDomain)) { entryURL = StringUtil.replaceFirst( entryURL, entryURLDomain, portalURLDomain); } return entryURL; }
public java.lang.String replaceFirst(java.lang.String s, java.lang.String[] oldSubs, java.lang.String[] newSubs) { return StringUtil.replaceFirst(s, oldSubs, newSubs); }
public static String replaceFirst( String s, String[] oldSubs, String[] newSubs) { if ((s == null) || (oldSubs == null) || (newSubs == null)) { return null; } if (oldSubs.length != newSubs.length) { return s; } for (int i = 0; i < oldSubs.length; i++) { s = replaceFirst(s, oldSubs[i], newSubs[i]); } return s; }
public java.lang.String replaceFirst(java.lang.String s, char oldSub, java.lang.String newSub) { return StringUtil.replaceFirst(s, oldSub, newSub); }
public java.lang.String replaceFirst(java.lang.String s, char oldSub, char newSub) { return StringUtil.replaceFirst(s, oldSub, newSub); }
public java.lang.String replaceFirst(java.lang.String s, java.lang.String oldSub, java.lang.String newSub) { return StringUtil.replaceFirst(s, oldSub, newSub); }
String articleId = rs.getString("articleId"); String newPortletId = StringUtil.replaceFirst( portletId, _OLD_ROOT_PORTLET_ID, _NEW_ROOT_PORTLET_ID);
String newLinkToLayout = StringUtil.replaceFirst( oldLinkToLayout, new String[] {
String templateName = StringUtil.replaceFirst( type, fieldNamespace.concat(StringPool.DASH), StringPool.BLANK);
String targetLayoutFriendlyUrl = StringUtil.replaceFirst( feed.getTargetLayoutFriendlyUrl(), StringPool.SLASH + newGroupFriendlyURL + StringPool.SLASH,
content = StringUtil.replaceFirst( content, _DATA_HANDLER_GROUP_FRIENDLY_URL, StringPool.BLANK, groupFriendlyUrlPos); groupUuid.contains(_TEMPLATE_NAME_PREFIX)) { content = StringUtil.replaceFirst( content, _DATA_HANDLER_GROUP_FRIENDLY_URL, group.getFriendlyURL(), groupFriendlyUrlPos); content = StringUtil.replaceFirst( content, StringPool.AT + groupUuid + StringPool.AT, StringPool.BLANK, groupFriendlyUrlPos); content = StringUtil.replaceFirst( content, _DATA_HANDLER_GROUP_FRIENDLY_URL, StringPool.BLANK, groupFriendlyUrlPos); content = StringUtil.replaceFirst( content, StringPool.AT + groupUuid + StringPool.AT, groupFriendlyUrlGroup.getFriendlyURL(), groupFriendlyUrlPos);