Skip to main content

New answers tagged

1 vote

Manipulation of two lists of strings and integers

...
eldo's user avatar
  • 75.1k
1 vote

Multiple calculations in a condition

A pedestrian answer with the two interpretations: ...
ubpdqn's user avatar
  • 61.6k
3 votes

Multiple calculations in a condition

list = {1, 2, 3, 82, 84, 1}; p = Position[list, x_ /; x > 3] {{4}, {5}} Erase <= 3 ...
eldo's user avatar
  • 75.1k
2 votes

Replace number in string with ? and /;

list = {"A4", "A#3"}; Map[StringJoin, Characters[list] /. {"A", d_?DigitQ, ___} :> {"B", d}] {"B4", "A#...
eldo's user avatar
  • 75.1k
2 votes

From string to number

A hash-free variant of E. Chan-López answer (no need to use Alternatives) ...
eldo's user avatar
  • 75.1k
2 votes

Merging certain list elements

list = {"ABC", "Abc", "Def", "1", "DEF", "Ghi", "Jkl", "MNO", "1,"}; ...
eldo's user avatar
  • 75.1k
2 votes

Delete strings: {name, John, John Doe, Doe} to {name, John Doe}

f = DeleteCases[#, Alternatives @@ Flatten @ Cases[StringSplit @ #, {_, _}]] &; ...
eldo's user avatar
  • 75.1k
2 votes

How to use `StringJoin` in the given example?

list = {{"abc", "0000"}, {"def", "1111"}}; Using the operator form of Insert ...
eldo's user avatar
  • 75.1k
1 vote

How do I remove parts of this data?

list = {{9.9, 0}, {"", ""}, {10.0, -21.7}, {"", ""}, {10.0, 28.5}, {"", ""}}; Using ...
eldo's user avatar
  • 75.1k
0 votes

Sorting alphanumeric strings

list = {"a16", "b22", "a8", "c1", "b18", "b2", "a1"}; Using ...
eldo's user avatar
  • 75.1k
1 vote

List of symbols wherein position encoded by number to string

list = {{"a", 6}, {"z", 1}, {"g", 2}, {"y", 12}}; Using SubsetMap (new in 12.0) ...
eldo's user avatar
  • 75.1k
2 votes

How to express the notion of "from "a" to the nearest "z"" with patterns?

Using sequence-functions (they get slow with long lists) c = Characters["azabczabvncz"] {"a", "z", "a", "b", &...
eldo's user avatar
  • 75.1k
7 votes

How to express the notion of "from "a" to the nearest "z"" with patterns?

str = "abczabvncz"; Borrowing the Shortest-pattern from vindobona (but with a triple underscore) ...
eldo's user avatar
  • 75.1k
4 votes

How to express the notion of "from "a" to the nearest "z"" with patterns?

...
lericr's user avatar
  • 29.2k
3 votes

Get alphabetical number of characters in string

str = "abcdefghijklmnopqrstuvwxyz"; Using LetterNumber (new in 10.1) ...
eldo's user avatar
  • 75.1k
0 votes
Accepted

All possible tuples satisfying conditions

I believe the following works. It generates all$^1$ candidate lists $\beta'$ such that $\sum_i i\beta_i' \leq d$ and then compares them element-wise to $\beta$. ...
march's user avatar
  • 23.8k
0 votes

StringCount in Mathematica

str = "one letters three letters letters one letters letters three letters"; Using StringCount in a simpler way ...
eldo's user avatar
  • 75.1k
2 votes

Convert integer to words of specific length

n = 10; l = 3; Using SequenceCases and Syed's permutations ...
eldo's user avatar
  • 75.1k
3 votes

How to select elements from a list of strings?

info = {"so96", "se35"}; Using Pick and ContainsAny ...
eldo's user avatar
  • 75.1k
1 vote

Element by element concatenation of two string lists

month = {"january", "february", "march"}; year = {"2013", "2014", "2015"}; A hash-free variant of ...
eldo's user avatar
  • 75.1k
1 vote

Application for StringDelete

list = {{"123 abc def 456"}, {"ghi jkl 789"}, {"012 mno pqr"}}; Folding ReplaceAt (new in 13.1) <...
eldo's user avatar
  • 75.1k
1 vote

String permutation

str = "abcd"; Using SubsetMap (new in 12.0) ...
eldo's user avatar
  • 75.1k
1 vote

Last part of a url (after the "/")

...
eldo's user avatar
  • 75.1k
2 votes

Extract substrings with defined length from a string

...
eldo's user avatar
  • 75.1k
1 vote
Accepted

Using List to create lists of strings: difference(s) between two one-line codes?

la = List[{"a", "b", "c"}, {"you", "are", "good"}]; lb = List[{a, b, c}, {you, are, good}]; ...
eldo's user avatar
  • 75.1k
0 votes

Duplicated points not labeled when presented to ListPlot as point->"label"

...
eldo's user avatar
  • 75.1k
1 vote

Is it possible to have ToString operate on an expression containing Prefix (@) ? for example exp = [email protected]

The problem here is that notation like f @ x doesn't exist on the expression level; there's no difference between f[x] and ...
Sjoerd Smit's user avatar
  • 23.7k
0 votes

Is it possible to have ToString operate on an expression containing Prefix (@) ? for example exp = [email protected]

It just so happens that your symbolic email parses to an actual Mathematica expression: ...
lericr's user avatar
  • 29.2k

Top 50 recent answers are included