10 Commits

Author SHA1 Message Date
LamTrinh.Dev
aca65acbc5
Correct available version macOS 10.10 for String+Essentials.swift (#886) 2024-08-28 13:44:03 -07:00
Tony Parker
65c6532a8e
See if String(contentsOf:) family can be implemented directly in Swift (#622) 2024-05-20 11:16:56 -07:00
Tony Parker
0be1758b4f Various fixes to make PropertyListEncoder and PropertyListDecoder build cross-platform 2024-03-06 15:57:33 -08:00
Tina Liu
9df5dc6518
(112770879) “Washington, D.c.” capitalized incorrectly (#212)
* (112770879) “Washington, D.c.” capitalized incorrectly

Theoretically "." is a case-ignorable character, so "D.C." is conceptually the same as "DC", whose capitalized mapping would be "Dc". This behavior doesn't seem to align with real-world use cases well though. Workaround this by splitting the string with "." and titlecasing each substring individually.

* (112770879) “Washington, D.c.” capitalized incorrectly, cont.

For FoundationPreview: Move String comparison utilities from FoundationEssentials fo _FoundationInternals so they can be accessed from FoundationInternalization too.
2023-07-31 10:51:34 -07:00
Joey
32bf8bc848
Documentation - Consistency Fixes (#187)
* Documentation for attributed string's number formatting.

* Documentation - Typos & Consistency Fixes
2023-06-29 10:55:29 -07:00
Tina Liu
7348693927
FoundationPreview: Stop relying on CharacterSet for trimming whitespace (#145)
* Generalize trimming function to take a predicate block. Move this function to FoundationEssentials.

* Call `_trimmingWhitespaces()` instead of through CharacterSet.

* Review feedback: rename the function to whitespace from whitespaces

* Add tests

* Standarize whitespacing and remove spaces in empty line
2023-05-26 13:11:35 -07:00
Guillaume Lessard
5c9bdf6205
Fix Memory Binding Issues (#94)
* fix memory binding

* use `load(as:)` instead of binding memory

* Use temporary binding rather than `bindMemory`

* use `load(as:)` and `storeBytes(of:as:)` as appropriate

* use temporary binding rather than binding assertions

* add a note about index validation
2023-05-09 13:47:26 -07:00
Alexander Cyon
09606b457d
Fix typos (#68) 2023-04-29 06:28:00 -07:00
Charles Hu
c01e9dadee
rdar://107955097 (FoundationPreview: Batch move string API (continued)) (#34)
* rdar://107955097 (FoundationPreview: Batch move string API (continued))

- Move localized uppercase and lowercase to FoundationLocalization
- if-def out of CharacterSet from FoundationPreview. It's not implemented at all there, and having a no-op stub is misleading

* rdar://107955097 (FoundationPreview: Batch move string API (continued))

- Move components separated by string and range of string functions

* rdar://107955097 (FoundationPreview: Batch move string API (continued))

Enable snake case options for JSON encoder and decoder. We haven't been able to enable this option because it needed `CharacterSet`, which hasn't been properly implemented for FoundationPreview. Now that we have `BuiltInUnicodeScalarSet`, which mirrors `CharacterSet`, we can switch to that and enable the options.

* rdar://107955097 (FoundationPreview: Batch move string API (continued))

- Move `StringProtocol.lineRange(for:)` and `paragraphRange(for:)` to FoundationEssentials
- Rename String+Regex.swift to RegexPatternCache.swift
- Consolidate extensions on various String family members and remove one redundant swift file

---------

Co-authored-by: I-Ting Tina Liu <iting_liu@apple.com>
2023-04-17 18:23:51 -07:00
Charles Hu
e2c177e867 Rebased on top of the new String APIs 2023-03-29 09:56:22 -07:00