U = nelson.lang.makeUniqueStrings(S)
U = nelson.lang.makeUniqueStrings(S, excludedStrings)
U = nelson.lang.makeUniqueStrings(S, whichStringsIdx)
U = nelson.lang.makeUniqueStrings(S, excludedStrings, maxStringLength)
U = nelson.lang.makeUniqueStrings(S, whichStringsIdx, maxStringLength)
[U, modified] = nelson.lang.makeUniqueStrings(...)
| Parameter | Description |
|---|---|
| S | string array, character vector, or cell array of character vectors. |
| excludedStrings | strings that generated values must not duplicate. |
| whichStringsIdx | numeric indices or logical mask selecting which elements to make unique. This argument is used instead of excludedStrings. |
| maxStringLength | positive integer scalar maximum output length. |
| Parameter | Description |
|---|---|
| U | unique strings, returned with the same text container type as S. |
| modified | logical array indicating which input elements were changed. |
nelson.lang.makeUniqueStrings appends suffixes such as _1 and _2 to selected elements until they are unique.
nelson.lang.makeUniqueStrings({'a', 'a', 'b', 'a'})
nelson.lang.makeUniqueStrings({'a', 'b'}, {'a', 'b'})
| Version | Description |
|---|---|
| 2.0.0 | initial version |