1. 程式人生 > >字串處理-1.1

字串處理-1.1

-- charindex 尋找字串位置

    CHARINDEX (@findStr, @baseStr [, @beginPoint ] )

@findStr   :想要找到的字串

@baseStr   :基礎字串,即被查詢的字串

@beginPoint:開始查詢的位置

 

-- substring 擷取字串

    SUBSTRING (@baseStr, @beginPoint, @endPoint)

@baseStr   :基礎字串

@beginPoint:開始擷取的位置

@endPoint:結束擷取的位置

注:擷取從下標為 beginPoint 開始到 下標為 endPoint-2的位置上