J'ai échantillon url http://citrine.rcd.dev:8080/image/1582_125x125.jpg
Regex pour ce match
Il est construit avec le code:
public string GetDerivativeUrl(long imageId, bool preserveTransparency, DerivativeSize size, bool allowCache, string designTags, int quality)
{
string tags = (designTags == null || designTags.Trim().Length == 0) ? "" : designTags;
string imageFormat = (preserveTransparency) ? "png" : "jpg";
if (quality > 0)
return String.Format("{0}/image/{4}{1}_{2}.{3}?qv={5}", GetUrlPrefix(imageId, allowCache), imageId, size.GetPixelSize(), imageFormat, tags, quality);
return String.Format("{0}/image/{4}{1}_{2}.{3}", GetUrlPrefix(imageId, allowCache), imageId, size.GetPixelSize(), imageFormat, tags);
}
Je veux obtenir http://citrine.rcd.dev:8080/image/1582.jpg
de http://citrine.rcd.dev:8080/image/1582_125x125.jpg
Comment puis-je faire?
ce qui ne va pas avec le retour 'String.Format ("{0}/image/{3} {1} {2}.", GetUrlPrefix (imageId, allowCache), ImageID, ImageFormat, étiquettes);'? – sehe
Alors voulez-vous changer la chaîne après qu'elle a été créée dans cette méthode ou voulez-vous changer la méthode afin qu'elle renvoie la chaîne que vous voulez? – sloth