# Tagged Questions

Questions on the manipulation of String objects in Mathematica, and the functions used for these manipulations.

957 views

### How to remove accents from text?

I would like to know how I can remove accents from a string. For example, how can I transform "string test áéíóú" into ...
71 views

### How to check String format?

How can I check if the string contains a real or integer number, space and string? e.g. StrCheck["156 af"] = true ...
49 views

### How to manipulate string parts?

Let's consider I have following string: "{a-> POR, b-> D610, c-> 0, d-> \"300/7\", e -> \"1/400\"}" How can I run over and update anything that is ...
249 views

### Converting strings of the form “1.34e5” to real numbers? [duplicate]

ToExpresssion doesn't understand real numbers of the form "1.34e5". How do I convert the string ...
195 views

### How do I dynamically construct a string from a variable number of 'PopupMenu's in 'Manipulate'?

I have a string with a variable length, determined by the value of a SetterBar and whose characters are determined by a corresponding number of ...
1k views

### DeleteCases on list of Strings

Consider the following: data={"AB","CD","AF"}; Now I would like to delete all String from data which starts with "A". Result:...
927 views

### Specifying string patterns in DeleteCases

It seems that DeleteCases is not compatible with string patterns, at least directly (see, for example, this question). Is this true? If so, why is this the case? ...
53 views

### Selecting from a list [duplicate]

OK, I know this must be a simple problem, but right now I'm just stuck and need some advice with this :). I have the following list: ...
49 views

### How do I complete this function len for the length of a line segment?

I need to have len[{{x1,y1},{x2,y2}}] is Sqrt[(x2-x1)^2+(y2-y1)^2]. The beginning of the function will be defined as ...
383 views

### Transform fancy usage messages in 1D string

When we look at the usage messages of built-in functions nowadays (not in the good old times, when they were a simple descriptions) we see that although they look pretty in the front end, it is really ...
475 views

### Strange answer from StringReplace

I have a list of strings and I would check if there is an empty string element, that's "", because I need to replace it with a "0". I try the following ...
157 views

### Turning a list of notes and timings into useful sheet music

I have two lists: ...
185 views

### Get a filename used in an import and store it as a variable

Hopefully a simple one for you (or at least seemingly)! I import a .txt file, from which i make a ListLinePlot. I simply want to read in the name of the file, store it in a variable so I can use it ...
87 views

### When is Unicode code point same as Mathematica CharacterCode?

For what characters c does CharacterCode[c] not return the same value as c's Unicode code point? How does one convert c to its Unicode code point with Mathematica ...
270 views

I am familiar with regular expressions in other languages (e.g., Perl, Python, ViM), but the Mathematica StringExpression is baffling me. I'd like to match strings ...
46 views

### How to process Result of StringReplace?

StringReplace["item_10", "item_" ~~ x__ -> x + 1] returns "1+10" How can I force it to evaluate to 11?
170 views

### How do I make a single character bold?

I have a string of characters, like "CDABOZPVRYXSWQEGNILUTHMKJF" and want to convert it to a string in which the character at position ...
94 views

### Using StringReplace to make file names

Often I'm making many plots for different values of parameters. Each plot has a nice PlotLabel with superscripts, subscripts and some special characters. I would ...
327 views

### Swap first and last names in a list

Edited to fix an inconsistency in the given example data format. I'm trying to write a simple function to load in a csv list of names which is formatted as "Lastname Firstname Initial " and ...
395 views

### Replace with position and order number

question conversion1 : Convert "[AA]AB[AA]BB[AA]B[AA]CCC" to "[A1A2]A3B1[A4A5]B2B3[A6A7]B4[A8A9]CCC" conversion2 : Convert <...
85 views

### Are all of the numbers in my file legitimate hex numbers

I have about 10,000 hexadecimal numbers (32 digits each) in an excel file, in one column. I want to verify that all of them are indeed hexadecimal number and that no other characters are present. My ...
89 views

### Is there a manual way to generate a string of zeroes with a 2 at the end?

How do I get mathematica to display 33141015 zeroes and a 2 I've tried using 2*10^-33141016 but it just gives me scientific notation Is there a manual way to generate a string that looks like ...
291 views

### Regular expression too large problem

pattern = Names["*"]; StringMatchQ["Bold", pattern[[1 ;; -1 ;; 2]]] (* True *) StringMatchQ["Bold", pattern] Error Information: RegularExpression::msg20:...
143 views

### Optimizing alphametrics code

First of all, thank you all in this great community. I have been reading a lot of threads about Mathematica optimization learning things like using Compile ...
80 views

### Using the string Match with options! [duplicate]

Here is what I want to do: I have a list of strings for example s={"red carpet","red box","black carpet","black box"} I want to use something like ...
609 views

### NotebookFind and String Pattern Expressions

Is there a way that NotebookFind can be used to match string pattern expressions rather than just strings? The documentation for ...
202 views

### How can I improve NumberString?

I would like to test strings to see if they represent numbers. This should include number representations with precision marks and scientific notation. NumberString ...
90 views

### Is the use of StringTemplate with a styled string documented behavior?

I was pleasantly surprised to find out that StringTemplate appears to work with styled (formatted) strings, with the style of the slots applied to the inserted ...
103 views

### How to efficiently find parts of a string with beginning and ending specified?

I'm trying to find specific URL addresses from a html document. The addresses can be found between the strings "href=\"" and "\" class=\"listing". The problem is not including strings like this: "href=...
216 views

### Convert recursive RegularExpression to StringExpression?

Consider the following expression for matching balanced brackets: ...
62 views

...
105 views

### Why doesn't ToString work in ReplaceAll? [duplicate]

I'm trying to use ReplaceAll in a subscript. However, it doesn't seem to work as expected if I want to use the output the subscript in a ...
147 views

### Strings with exclamation marks in Mathematica [duplicate]

Given this input FullForm[ToString[TraditionalForm[x]]] Mathematica outputs "\!$$TraditionalForm\`x$$" It seems like ...
233 views

### Limit characters/digits entered into InputField

When using InputField, whether setting the input type as a Number or String, is there a way ...
174 views

### Exctrating data information from a file.txt

I really did previous long search in the site and I couldn't find any answer that might help me. So I am asking it. I have the following data set, https://onedrive.live.com/redir?resid=...
316 views

### Get the wrong result using the StringCase function and Shortest option

I have a list of strings like this ...
161 views

### How to convert expression with Subscript to string

I've tried ToString[], but it doesn't work properly with subscripts: How to convert expr with subscript to string with exactly the same FullForm that "expr" has?
147 views

### Parsing string with nested information

I am trying to parse a string, but I have no idea how to solve the following problem ...
209 views

### Decimal-to-ASCII conversion

I have to write a program that converts a number (decimal notation) to an ASCII string. For example, x = 26728 (or 0x6868) and the string is "hh". I wrote this, but it seems that it is not the ...
88 views

### Geodesy without units?

Suppose I'm interested in the latitude of Los Angeles and I do the following: ...
44 views

### How can I convert a matrix into matlab form string? [duplicate]

How can I convert a matrix into matlab form? ...
68 views

### Data file organized in strings

I am working in a data set : The original question, They are strings of thousands stars,and each one contains a lot of parameters, and the following item is called identifies, they are the names (...
171 views

### LetterCharacter for Cyrillic symbols

Why does the code StringMatchQ["ы", LetterCharacter] return False? Probably because: ...
213 views

### Unexpected result from StringReplace

The following works as expected. StringReplace["xxxyxz", "x" ~~ _ -> "ww"] "wwwwww" And so does this. ...
273 views

### how to extract the string using regular expressions

I have the list : a1 = {"struct name1 {","struct name2{","struct name3{","struct name4{", "struct name5{","struct lastStruct{"} I tried to extract the ...
172 views

### how to make a recursive function to analyse this file

I am stuck at this problem beginning We assume we have keyword k, and the structure in the file: file.txt ...