Araq
3174cfe55c
make tests green again
2017-11-01 00:20:40 +01:00
Bo Lingen
c182d37f45
Update removeSuffix implementations to match removePrefix ( #6636 )
2017-10-30 22:45:13 +01:00
Andreas Rumpf
74640862cb
Merge branch 'devel' of github.com:nim-lang/Nim into devel
2017-10-29 20:36:21 +01:00
Fabian Keller
293a873051
fixes #6589 ( #6590 )
2017-10-29 20:09:46 +01:00
Andreas Rumpf
6a3288a60e
more replacements for the deprecated '<'
2017-10-29 08:55:30 +01:00
Bo Lingen
e135135469
add strutils.removePrefix proc ( #6473 )
2017-10-28 10:47:23 +02:00
Dmitry Atamanov
93fd0b0cb5
strutils.find enhancements ( #6582 )
2017-10-28 09:30:19 +02:00
Viktor Marosvary
ce04288d64
isAlphaNumberic and isDigit improvement + tests ( #6579 )
...
if we encounter a character that does not satisfy the proc, we return immediately, without continuing to loop over the rest of the chars in the string.
2017-10-24 10:22:18 +02:00
Silvio
424b998f72
Fix removeSuffix rst code blocks
...
Add newline before `code-block` for `removeSuffix`
2017-10-23 11:11:08 +02:00
Dominik Picheta
ecfbe4940b
Merge pull request #6051 from couven92/alignLeft
...
Add left-aligning string proc to strutils
2017-10-22 23:11:13 +01:00
Andreas Rumpf
3308d26581
breaking change: arrays of char do not convert to cstring; ptr to array of char does
2017-10-10 00:17:20 +02:00
Andreas Rumpf
9b1a23c554
minor breacking change: in string formats '' the '1' is now interpreted as a number, not as an identifier. This is more consistent with the rest of the mini language and allows '12'.
2017-10-06 08:28:16 +02:00
Andreas Rumpf
2b592a6425
in prepration for the upcoming different integer inference rules
2017-09-16 10:29:29 +02:00
Simon Krauter
94e336fe85
Fix wrong result of countLines() ( #6371 )
2017-09-15 10:45:22 +02:00
Fredrik Høisæther Rasch
37a615a31f
Added Multi-Replacement proc for strings ( #6193 )
2017-08-07 19:58:11 +02:00
Fredrik Høisæther Rasch
177a634992
Add safeties for alignLeft
2017-07-04 11:52:54 +02:00
Fredrik Høisæther Rasch
9823c677b8
Augment align proc with alignLeft proc
2017-07-04 11:52:37 +02:00
Markus F.X.J. Oberhumer
a0f39e0ab4
Ascii character code 127 (DEL) is not printable and must be quoted. ( #5984 )
...
This is a follow-up to #5823 .
2017-06-15 20:42:23 +02:00
Simon Krauter
40e9e751f0
Extend documenation of formatFloat() ( #5799 )
...
Added line: "If ``precision == 0``, it tries to format it nicely." (copied from formatBiggestFloat())
2017-05-13 21:50:44 +02:00
Andreas Rumpf
9f5492becd
strutils.nim: make removeSuffix robust on empty strings
2017-03-18 10:42:11 +01:00
Simon Krauter
a42801d100
Make countLines() the same as len(splitLines(s)) ( #5470 )
...
The result of countLines() is now increased by 1 compared to the old
version.
Fixes #5460 .
2017-03-03 01:31:17 +01:00
Araq
5ce8e0b5cd
better docs for strutils.escape
2017-02-26 01:02:50 +01:00
Dennis Felsing
4af2c26c91
Make toHex work for uints ( #5423 )
2017-02-24 16:48:22 +01:00
flyx
ac9c2126e6
Added BiggestUInt ( #5378 )
2017-02-13 11:20:07 +01:00
Parashurama
d04ca6ef23
Improve & optimize strutils 'find' procs ( #5196 )
...
* add 'last' argument to 'find' procs in strutils
* add 'rfind' proc for looking up set[char] in strutils
* use optimised C function 'memchr' when available
2017-01-11 09:48:31 +01:00
Chris Heller
7ad32ea0ed
Change error handling in split to use doAssert so it is not compiled out when running tests
2016-12-21 22:24:08 -08:00
Chris Heller
80a727f1ce
Change error handling to use assert as per Araq's comment
2016-12-21 12:15:33 -08:00
Chris Heller
40d034b7e3
Guard against calling split with an empty string as a separator. Fixes #5119
2016-12-21 12:06:59 -08:00
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