4
$\begingroup$

While working on How to capitalize the first letter of each word in a string and trying to understand why certain characters were not considered letters I tried this:

StringCases["áéíóöőüű", _?LetterQ]
LetterQ::string: String expected at position 1 in LetterQ[Removed[$$Failure]]. >>

LetterQ::string: String expected at position 1 in LetterQ[Removed[$$Failure]]. >>

LetterQ::string: String expected at position 1 in LetterQ[Removed[$$Failure]]. >>

General::stop: Further output of LetterQ::string will be suppressed during this calculation. >>

{}

I then tried a Print function to see what was going on:

StringCases["áéíóöőüű", _?Print];
á  
é  
í  
ó  
ö  
ő  
ü  
ű  

No errors. Then I tried a function that Prints, but returns True:

StringCases["áéíóöőüű", _?((Print["(", FullForm@#, ")"]; True) &)]

This produced interleaved lines of characters (expected) and Removed[$$Failure] (not expected). I can't include the output properly because of this StackExchange bug.

  • What is the cause of this?

  • Has it been fixed since version 7?

$\endgroup$
4
  • $\begingroup$ Does not happen for me (v8.0.4 Linux64). StringCases["áéíóöőüű", _?LetterQ] == Characters["áéíóöőüű"] $\endgroup$ Commented Sep 10, 2013 at 14:30
  • $\begingroup$ I get the same message for MMA 7.0 on mac OSX, but in version 9.0.0 it works fine. $\endgroup$ Commented Sep 10, 2013 at 14:34
  • $\begingroup$ There is no explicit Removed[$$Failure] at all under Win7, v9.0.1. $\endgroup$ Commented Sep 10, 2013 at 14:49
  • $\begingroup$ No problems in either 8 or 9 (Win7-64). BTW I remember researching related matters. See my comments here. $\endgroup$ Commented Sep 10, 2013 at 19:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.