Question: I am working with a label and form which I want to center in the row, but encountering difficulties to do that. The label wont move to center next to the input field without moving the field down. This is the code:

```
<div class="row"> 
            <div class="col-md-6">
                <div class="form-group">
                    <label class="col-md-6 control-label pull right">Password: </label>
                    <div class="col-md-6">
                        <input type="text" name="Password" class='form-control'  />
                    </div>
                </div>
            </div>
    </div>

```

Answer: 
You can do this very nicely with the `str_first_number()` function from the `strex` package, or for more general needs, you can use the `str_nth_number()` function. Install it with `install.packages("strex")`. 

```
library(strex)
#> Loading required package: stringr
strings <- c("Pic 26 + 25", "Pic 27 + 28", "Pic 28 + 27",
             "Pic 29 + 30", "Pic 30 + 29", "Pic 31 + 32")
str_first_number(strings)
#> [1] 26 27 28 29 30 31
str_nth_number(strings, n = 1)
#> [1] 26 27 28 29 30 31

```
To follow up your `strsplit` attempt:

```
# split the strings
l <- strsplit(x = c("Pic 26 + 25", "Pic 27 + 28"), split = " ")
l
# [[1]]
# [1] "Pic" "26"  "+"   "25" 
# 
# [[2]]
# [1] "Pic" "27"  "+"   "28" 

# extract relevant part from each list element and convert to numeric
as.numeric(lapply(l , `[`, 2))
# [1] 26 27

```