• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Prayer

            在一般中尋求卓越
            posts - 1256, comments - 190, trackbacks - 0, articles - 0
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            rtrim()

            Posted on 2008-12-30 16:48 Prayer 閱讀(1799) 評論(0)  編輯 收藏 引用 所屬分類: C/C++
            / * The rtrim() function removes trailing spaces from a string. * /.
            char * rtrim(char * str)
            {
                int n = strlen(str)-1; / * Start at the character BEFORE
                                           the null character (\0). * / 
                while (n>0) / * Make sure we don’t go out of hounds. . . * /
                {
                    if ( * (str + n) 1 =’ ’) / * If we find a nonspace character: * /
                    {
                        * (str+n+1) = ’\0’ ; / * Put the null character at one
                                                 character past our current
                                                 position. * /
                        break ; / * Break out of the loop. * /
                    }
                    else / * Otherwise , keep moving backward in the string. * /.
                        n--;
                }
                return str;    /*Return a pointer to the string*/
            }
                在上例中,rtrim()是用戶編寫的一個函數,它可以刪去字符串尾部的空格。函數rtrim()從字符串中位于null字符前的那個字符開始往回檢查每個字符,當遇到第一個不是空格的字符時,就將該字符后面的字符替換為null字符。因為在C語言中null字符是字符串的結束標志,所以函數rtrim()的作用實際上就是刪去字符串尾部的所有空格。
            婷婷久久久亚洲欧洲日产国码AV| MM131亚洲国产美女久久| 国产精品九九久久免费视频| 精品久久人人做人人爽综合| 中文字幕久久久久人妻| 久久久久中文字幕| 亚洲人成网亚洲欧洲无码久久| 久久精品99久久香蕉国产色戒 | 亚洲中文字幕无码一久久区| 久久精品国产网红主播| 性做久久久久久久久久久| 久久亚洲精品人成综合网| 精品久久久久久无码免费| 色综合久久久久综合体桃花网| 99久久精品免费| 久久精品国产亚洲av水果派 | 久久青草国产精品一区| 久久亚洲AV无码精品色午夜麻豆| 欧美亚洲国产精品久久蜜芽| 人妻无码αv中文字幕久久 | 色诱久久av| 久久久WWW成人免费毛片| 精品免费tv久久久久久久| 一本色道久久99一综合| 久久人人爽人人爽人人片AV东京热| 99久久成人国产精品免费| 天天爽天天狠久久久综合麻豆| 尹人香蕉久久99天天拍| 色综合久久中文字幕综合网| 中文字幕亚洲综合久久2| 久久精品国产半推半就| 国产精品视频久久| 亚洲精品高清国产一久久| 国产精品久久久久久影院| 久久国产精品99久久久久久老狼 | 麻豆精品久久久一区二区| 国产亚洲美女精品久久久久狼| 高清免费久久午夜精品| 99国产精品久久| 久久精品中文字幕第23页| 久久狠狠一本精品综合网|