New() public method

public New ( ) : JsString
return JsString
コード例 #1
0
        protected JsInstance DecodeURI(JsInstance[] arguments)
        {
            if (arguments.Length < 1 || arguments[0] == JsUndefined.Instance)
            {
                return(StringClass.New());
            }

            return(this.StringClass.New(HttpUtility.UrlDecode(arguments[0].ToString())));
        }
コード例 #2
0
        protected JsInstance DecodeURI(JsInstance[] arguments)
        {
            if (arguments.Length < 1 || arguments[0] == JsUndefined.Instance)
            {
                return(StringClass.New());
            }

            return(this.StringClass.New(Uri.UnescapeDataString(arguments[0].ToString().Replace("+", " "))));
        }
コード例 #3
0
        public JsInstance ToTimeStringImpl(JsDictionaryObject target, JsInstance[] parameters)
        {
            if (double.IsNaN(target.ToNumber()))
            {
                return((JsInstance)this.Global.StringClass.New(double.NaN.ToString()));
            }
            JsStringConstructor stringClass = this.Global.StringClass;
            DateTime            dateTime    = JsDateConstructor.CreateDateTime(target.ToNumber());

            dateTime = dateTime.ToLocalTime();
            string str = dateTime.ToString(JsDate.TIMEFORMAT, (IFormatProvider)CultureInfo.InvariantCulture);

            return((JsInstance)stringClass.New(str));
        }
コード例 #4
0
        public JsInstance ToLocaleDateStringImpl(
            JsDictionaryObject target,
            JsInstance[] parameters)
        {
            if (double.IsNaN(target.ToNumber()))
            {
                return((JsInstance)this.Global.StringClass.New(double.NaN.ToString()));
            }
            JsStringConstructor stringClass = this.Global.StringClass;
            DateTime            dateTime    = JsDateConstructor.CreateDateTime(target.ToNumber());

            dateTime = dateTime.ToLocalTime();
            string str = dateTime.ToString(JsDate.DATEFORMAT);

            return((JsInstance)stringClass.New(str));
        }