本文整理汇总了C#中JsString.lastIndexOf方法的典型用法代码示例。如果您正苦于以下问题:C# JsString.lastIndexOf方法的具体用法?C# JsString.lastIndexOf怎么用?C# JsString.lastIndexOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsString
的用法示例。
在下文中一共展示了JsString.lastIndexOf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: correctPaths
/*
*
* We dont need this right now but keeping the code cause we might need it again someday soon
JsString correctPaths(JsString sheet, JsString urlPrefix) {
//First, fix the path of any objects in the system. This fines url references and preprends paths
//Right now this just works for relative urls, I am going to need to fix it for absolute
//Now using this one instead for optional quotes
//(url\s?\(\s?['"]?)([\w\W]*?)(['"]?\s?\))
var pathReplace = new JsRegExp("(url\\s?\\(\\s?[\'\"]?)([\\w\\W]*?)([\'\"]?\\s?\\))", "g");
JsString replacementString = "$1" + urlPrefix + "/$2$3";
sheet = sheet.replace(pathReplace, replacementString);
return sheet;
}*/
void resolveSheet(JsString url)
{
var sheetRequest = new XMLHttpRequest();
JsString behaviorSheet = "";
JsString prefix;
sheetRequest.open("GET", url, false);
sheetRequest.send("");
if (sheetRequest.status == 404) {
throw new JsError("Cannot Find StyleSheet " + url);
}
int lastSlash = url.lastIndexOf("/");
prefix = url.substring(0, lastSlash);
parseAndPersistBehaviors(sheetRequest.responseText);
}