如何把用逗号等字符隔开的字符串转换成列表,下面依逗号分隔符为例: 比如有一个字符串,其值为:香港,张家港,北京,上海用SQL把这个字符串转换成列表的方法是: 1.方法一 WITH A AS (SELECT '香港,张家港,北京,上海' A FROM DUAL) ,SUBSTR(A,C),SUBSTR(A,C,B-C)) city FROM ( ,) C FROM( ,LEVEL) B,LEVEL LV FROM A CONNECT ) ) 输出结果是: 香港 张家港 北京 上海 应用举例:如果t
今天在写代码的时候遇到了点问题,特意记下,以免忘记!四舍五入方法: // num为传入的值,n为保留的小数位 function fomatFloat(num,n){ var f = parseFloat(num); if(isNaN(f)){ return false; } f = Math.round(num*Math.pow(10, n))/Math.pow(10, n); // n 幂 var s = f.toString(); var rs = s.indexOf('.'); //判定如
ConvertJson.cs类 using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Reflection; using System.Collections; using System.Data.Common; namespace DotNet.Utilities { //JSON转换类 public class ConvertJson { #regi
将字符串形式的日期转换成日期对象 var strTime="2011-04-16"; //字符串日期格式 var date= new Date(Date.parse(strTime.replace(/-/g, "/"))); //转换成Data(); var month=date.getMonth()+1; //获取当前月份 -----------------------------------------------------------
ConvertJson.cs类 using System; using System.Collections.Generic; using System.Text; using System.Data; using System.Reflection; using System.Collections; using System.Data.Common; namespace DotNet.Utilities { //JSON转换类 public class ConvertJson { #regi