Commit Graph

157 Commits

Author SHA1 Message Date
Andreas Rumpf
439f43fc52 better memory tracking 2016-11-22 08:40:57 +01:00
Zajcev Evgeny
b1a369d2fb [enh] isUpperAscii*, isLowerAscii* speedup execution by stopping
iteration as soon as possible
2016-11-07 13:21:17 +03:00
Andreas Rumpf
60b187513e stdlib and compiler don't use .immediate anymore 2016-07-29 23:51:01 +02:00
Andreas Rumpf
6d9177c6f1 added strutils.splitWhitespace 2016-07-06 11:59:20 +02:00
Andreas Rumpf
b56e5e159a Merge pull request #4361 from jyapayne/fix_split
Fix #4305: Make split proc for set[char] consistent
2016-07-02 17:55:57 +02:00
Joey Payne
e0203a4463 Add useful unicode procs for string manipulation
Added: isUpper, isLower, isAlpha, isWhiteSpace, toUpper,
toLower, and capitalize

Renamed strutils procs that are similar to avoid conflicts
2016-07-01 07:37:35 -06:00
Joey Payne
79a8a5ee72 Add transition define for old split behavior 2016-07-01 07:24:30 -06:00
Joey Payne
76f81d4aa4 Fix #4305: Make split proc for set[char] consistent 2016-07-01 07:24:30 -06:00
Euan
f84911364a Fixing isNilOrWhitespace to handle empty/nil. 2016-06-24 10:51:13 +01:00
Euan
746357404c Fixing isNilOrWhitespace for empty/nil strings.
`isSpace` returns false for an empty string, which is the opposite of
this method.
2016-06-24 10:50:26 +01:00
Euan
d932cb1e51 Adding isNilOrEmpty and isNilOrWhitespace
As discussed in #4184, this patch adds `isNilOrEmpty` and
`isNilOrWhitespace` to `strutils`.

It also modifies the existing `isSpace` proc slightly to exit early
rather than looping through all characters in a string.
2016-06-24 10:18:46 +01:00
Andreas Rumpf
42251f0b6b moved expandTabs to strmisc 2016-06-15 17:15:27 +02:00
Joey Payne
84d9081e21 Move partition and rpartition to new strmisc module
This was done because partition is an uncommonly used proc that is still
useful in rare cases. There is also a desire to add more procs to this
module at a later time.
2016-06-13 20:54:58 -06:00
Joey Payne
f6e30981a8 Add new procs for string manipulation
Add center, isTitle, title, partition, rpartition, rsplit, swapCase,
translate, and expandTabs
2016-06-13 20:54:23 -06:00
A. S. Budden
2f16854d0f Added inline pragmas. 2016-06-06 18:43:39 +01:00
A. S. Budden
d8480c73b6 Added startsWith/endsWith implementations for character prefix/suffix (fixes #4252). 2016-06-06 10:03:46 +01:00
Andreas Rumpf
c5b47628e4 Merge pull request #4261 from abudden/4197-formatEng
Implemented string formatting functions for engineering format
2016-06-02 13:55:57 +02:00
A. S. Budden
47b707cd32 Implemented string formatting functions for engineering format (fixes #4197). 2016-06-02 10:27:55 +01:00
A. S. Budden
d16f864b7b Added missing noSideEffect pragma 2016-06-02 10:25:51 +01:00
Andreas Rumpf
c11de219e5 Merge pull request #4250 from abudden/4198-formatSize
Reimplementation of formatSize to return a more meaningful value
2016-06-02 09:54:11 +02:00
A. S. Budden
29c8c83972 Modified trimZeros to modify the passed value. 2016-06-01 20:15:55 +01:00
Andreas Rumpf
f125f2e4ce make split with strings as separator faster 2016-06-01 19:34:02 +02:00
Andreas Rumpf
dc4a30c6b1 adds strutils.toHex variant that knows about the used integer size 2016-06-01 17:59:58 +02:00
A. S. Budden
1b2c599854 Moved zero trimming into a separate function (code review comment) 2016-06-01 14:30:02 +01:00
A. S. Budden
d855ad7045 Reimplementation of formatSize to return a more meaningful value (fixes #4198). 2016-06-01 12:56:01 +01:00
Andreas Rumpf
4e83a24662 Merge branch 'maxsplit' of https://github.com/mjoud/Nim into mjoud-maxsplit 2016-05-28 17:50:36 +02:00
Araq
33aeadab73 minor whitespace change 2016-05-10 22:03:07 +02:00
Dominik Picheta
73e48f9c9c Fixes #4037 2016-04-04 13:39:42 +01:00
Anatoly Galiulin
9aa845c6b6 Add parseUInt and parseBiggestUInt functions to stdlib (parseutils, strutils) 2016-03-30 17:38:57 +06:00
def
78d1b282ca Make strutils.join with with generic openarrays 2016-03-06 17:56:53 +01:00
Andreas Rumpf
2c2ab6884c fixes strutils.unescape; refs #3634 2016-01-17 21:29:25 +01:00
Yuriy Glukhov
2fcc37fd2b fixed float formatting for js 2015-11-26 01:10:52 +02:00
Charles Blake
716c12a436 Fix loop index bug in scan for a[s] in b[s..s+len2-1].
a, b must both be indexed starting from s after the common
prefix "strip" phase.  This resolves issue 3477:
  https://github.com/nim-lang/Nim/issues/3477
2015-11-19 06:52:31 -05:00
Magnus Jöud
755d89e32d modified strutils.split 2015-10-14 15:29:27 +02:00
Magnus Jöud
4e8e5af934 added tests for strutils.split 2015-10-14 14:00:51 +02:00
Magnus Jöud
739a8ea060 added maxsplit argument to strutils.split 2015-10-14 13:44:20 +02:00
JamesP
36cf87e6a9 add {.pop.} for {.push debugger:off.} to balance push/pop 2015-10-14 09:11:19 +10:00
Joey Payne
2d256a4489 Made strutils string test procs less redundant. 2015-10-10 09:13:00 -06:00
Joey Payne
ea9a1e26be Added tests for string test procs. 2015-10-10 08:55:19 -06:00
Joey Payne
e3bc27ac15 Changed alphanumeric check to "or" instead of "and". 2015-10-10 08:40:52 -06:00
Joey Payne
bb570de994 Added useful procs to strutils for string testing.
Added procs:

    isAlpha
    isAlphaNumeric
    isDigit
    isSpace
    isUpper
    isLower
2015-10-09 22:09:21 -06:00
Araq
8e9c0db66d strutils: wrap too long lines 2015-10-06 15:50:58 +02:00
Dominik Picheta
808253370b Implement strutils.indent 2015-09-11 14:35:25 +01:00
Araq
1e597c6332 formatFloat takes an optional decimalSep parameter 2015-09-01 23:41:03 +02:00
Zach Aysan
d886c44931 Add extern pragma 2015-07-21 15:51:47 -04:00
Zach Aysan
d2c992c03d Add docs 2015-07-21 15:49:05 -04:00
Zach Aysan
99b29b3e97 Switch to removeSuffix name and modify the string in place 2015-07-21 15:10:03 -04:00
Zach Aysan
a291f2c271 Create Ruby-like chomp proc to allow for easy string ending removal 2015-07-17 16:25:58 -04:00
patrick dw
15e7fe787a renamed writeln to writeLine in lib 2015-06-19 01:02:22 -05:00
pdw
d18e18060e lib/pure/p-t - Dropped 'T' from types 2015-06-04 13:18:36 +02:00