0
$\begingroup$

I have a list with several sub lists containing either strings or integers. I'd like to delete all list with strings.

The following list

{{1, 2, 3, 4}, {2, 4, 5, 6, 6, 7}, {1, 23}, {"SomeString"}}

should become

{{1, 2, 3, 4}, {2, 4, 5, 6, 6, 7}, {1, 23}}
$\endgroup$
2
$\begingroup$

This is an application for DeleteCases:

list = {{1, 2, 3, 4}, {2, 4, 5, 6, 6, 7}, {1, 23}, {"SomeString"}}

DeleteCases[list, {_String}]
$\endgroup$
  • $\begingroup$ Here you were faster... I would do the same, but with __String instead $\endgroup$ – Murta Feb 8 '15 at 22:16
  • $\begingroup$ :-). The field is now up to you. In Germany time to go to bed now, so keep on ... $\endgroup$ – mgamer Feb 8 '15 at 22:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.