我需要将此号码0331234转换为033-1234,以便将其格式化为银行BSB号码。
是否有一种聪明的方法来实现string.substring等的这一部分。
答案 0 :(得分:2)
public class LocationPluginBootstrap
: MvxLoaderPluginBootstrapAction<MvvmCross.Plugins.Location.PluginLoader, MvvmCross.Plugins.Location.Fused.Droid.Plugin>
{
}
答案 1 :(得分:1)
试试这个,
let { Cc,Ci } = require("chrome");
var activityDistributor = Cc["@mozilla.org/network/http-activity-distributor;1"].getService(Ci.nsIHttpActivityDistributor);
var httpObserver = {
observeActivity: function(aHttpChannel, aActivityType, aActivitySubtype, aTimestamp, aExtraSizeData, aExtraStringData){
if (aActivityType == nsIHttpActivityObserver.ACTIVITY_TYPE_HTTP_TRANSACTION) {
switch(aActivitySubtype) {
case nsIHttpActivityObserver.ACTIVITY_SUBTYPE_RESPONSE_HEADER:
// received response header
break;
case nsIHttpActivityObserver.ACTIVITY_SUBTYPE_RESPONSE_COMPLETE:
console.log('recieved !!!')
break;
}
}
}
};
activityDistributor.addObserver(httpObserver);