time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

README.md (4130B)


      1 <!--
      2 
      3 @license Apache-2.0
      4 
      5 Copyright (c) 2018 The Stdlib Authors.
      6 
      7 Licensed under the Apache License, Version 2.0 (the "License");
      8 you may not use this file except in compliance with the License.
      9 You may obtain a copy of the License at
     10 
     11    http://www.apache.org/licenses/LICENSE-2.0
     12 
     13 Unless required by applicable law or agreed to in writing, software
     14 distributed under the License is distributed on an "AS IS" BASIS,
     15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16 See the License for the specific language governing permissions and
     17 limitations under the License.
     18 
     19 -->
     20 
     21 # Uncapitalize
     22 
     23 > Uncapitalize the first character of a string.
     24 
     25 <section class="usage">
     26 
     27 ## Usage
     28 
     29 ```javascript
     30 var uncapitalize = require( '@stdlib/string/uncapitalize' );
     31 ```
     32 
     33 #### uncapitalize( str )
     34 
     35 Uncapitalizes the first character of a `string`.
     36 
     37 ```javascript
     38 var out = uncapitalize( 'Last man standing' );
     39 // returns 'last man standing'
     40 
     41 out = uncapitalize( 'Hidden Treasures' );
     42 // returns 'hidden Treasures'
     43 ```
     44 
     45 </section>
     46 
     47 <!-- /.usage -->
     48 
     49 <section class="examples">
     50 
     51 ## Examples
     52 
     53 <!-- eslint no-undef: "error" -->
     54 
     55 ```javascript
     56 var uncapitalize = require( '@stdlib/string/uncapitalize' );
     57 
     58 var out = uncapitalize( 'Last man standing' );
     59 // returns 'last man standing'
     60 
     61 out = uncapitalize( 'Presidential election' );
     62 // returns 'presidential election'
     63 
     64 out = uncapitalize( 'JavaScript' );
     65 // returns 'javaScript'
     66 
     67 out = uncapitalize( 'Hidden Treasures' );
     68 // returns 'hidden Treasures'
     69 ```
     70 
     71 </section>
     72 
     73 <!-- /.examples -->
     74 
     75 * * *
     76 
     77 <section class="cli">
     78 
     79 ## CLI
     80 
     81 <section class="usage">
     82 
     83 ### Usage
     84 
     85 ```text
     86 Usage: uncapitalize [options] [<string>]
     87 
     88 Options:
     89 
     90   -h,    --help                Print this message.
     91   -V,    --version             Print the package version.
     92          --split sep           Delimiter for stdin data. Default: '/\\r?\\n/'.
     93 ```
     94 
     95 </section>
     96 
     97 <!-- /.usage -->
     98 
     99 <!-- CLI usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
    100 
    101 <section class="notes">
    102 
    103 ### Notes
    104 
    105 -   If the split separator is a [regular expression][mdn-regexp], ensure that the `split` option is either properly escaped or enclosed in quotes.
    106 
    107     ```bash
    108     # Not escaped...
    109     $ echo -n $'Beep\nBoop' | uncapitalize --split /\r?\n/
    110 
    111     # Escaped...
    112     $ echo -n $'Beep\nBoop' | uncapitalize --split /\\r?\\n/
    113     ```
    114 
    115 -   The implementation ignores trailing delimiters.
    116 
    117 </section>
    118 
    119 <!-- /.notes -->
    120 
    121 <section class="examples">
    122 
    123 ### Examples
    124 
    125 ```bash
    126 $ uncapitalize Beep
    127 beep
    128 ```
    129 
    130 To use as a [standard stream][standard-streams],
    131 
    132 ```bash
    133 $ echo -n 'Beep' | uncapitalize
    134 beep
    135 ```
    136 
    137 By default, when used as a [standard stream][standard-streams], the implementation assumes newline-delimited data. To specify an alternative delimiter, set the `split` option.
    138 
    139 ```bash
    140 $ echo -n 'Beep\tBOOP' | uncapitalize --split '\t'
    141 beep
    142 bOOP
    143 ```
    144 
    145 </section>
    146 
    147 <!-- /.examples -->
    148 
    149 </section>
    150 
    151 <!-- /.cli -->
    152 
    153 <!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
    154 
    155 <section class="related">
    156 
    157 * * *
    158 
    159 ## See Also
    160 
    161 -   <span class="package-name">[`@stdlib/string/capitalize`][@stdlib/string/capitalize]</span><span class="delimiter">: </span><span class="description">capitalize the first character in a string.</span>
    162 -   <span class="package-name">[`@stdlib/string/lowercase`][@stdlib/string/lowercase]</span><span class="delimiter">: </span><span class="description">convert a string to lowercase.</span>
    163 
    164 </section>
    165 
    166 <!-- /.related -->
    167 
    168 <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
    169 
    170 <section class="links">
    171 
    172 [standard-streams]: https://en.wikipedia.org/wiki/Standard_streams
    173 
    174 [mdn-regexp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
    175 
    176 <!-- <related-links> -->
    177 
    178 [@stdlib/string/capitalize]: https://github.com/stdlib-js/string/tree/main/capitalize
    179 
    180 [@stdlib/string/lowercase]: https://github.com/stdlib-js/string/tree/main/lowercase
    181 
    182 <!-- </related-links> -->
    183 
    184 </section>
    185 
    186 <!-- /.links -->