Quantcast
Channel: Active questions tagged string-manipulation - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 189

Rule-based deletions from string list

$
0
0

I have a list of strings:

lis = {"a","b","c","12","d","q","r","X","s"}

I'd like to delete list members starting with "X" moving backwards through the list from "X" until a list member that's a digit character is found, to get:

res = {"a","b","c","12","s"}

Not sure how to use DeleteCases here?


Viewing all articles
Browse latest Browse all 189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>