I have method
public static string UrlImageName(string name)
{
if (name.IndexOf("_180x140") <= 0)
{
var extPos = name.LastIndexOf(".");
return name.Substring(0, extPos) + "_180x140" + name.Substring(extPos, name.Length);
}
return name;
}
and view
<div class="car-img">
<img src="@IKWelcomeScreenCellViewModel.UrlImageName(viewModel.SlideShowUrls[0])" />
</div>
names are like this "http://www.ua/Content/images/ik-main-page/Catalog.png"
and I need this http://www.ua/Content/images/ik-main-page/Catalog_180x140.png
error Index and length must refer to a location within the string