Question: I have a list from which I would like to create a sublist from this:

```
lis = {{a,X,b},{c,d,e,X,f},{h,j,X}}

```

giving:

```
res = {{a},{c,d,e},{h,j}}

```

i.e., deleting each X and its following elements from each sublist. Likely asked and answered, any pointers greatly appreciated!

Answer: 
You can use `ReplaceAll` with an appropriate pattern in such cases

```
{{a, X, b}, {c, d, e, X, f}, {h, j, X}} /. {begin___, X, end___} :> {begin}

```

Note the use of named patterns of the `BlankNullSequence` variety that can stand for any sequence of zero or more expressions
Using [`Position`](http://reference.wolfram.com/language/ref/Position.html)

```
lis = {{a, X, b}, {c, d, e, X, f}, {h, j, X}};

#[[1 ;; Position[#, X][[1, 1]] - 1]] & /@ lis

(*  {{a}, {c, d, e}, {h, j}}  *)

```