Given that points A, B, and C are collinear with B between A and C, we have the following distances:
- \( AC = 18 \)
- \( BC = 4 \)
We can express the relationship among the points in terms of distances. Since \( B \) is between \( A \) and \( C \), we can express \( AC \) as the sum of \( AB \) and \( BC \):
\[ AC = AB + BC \]
Substituting the known values:
\[ 18 = AB + 4 \]
Now, we solve for \( AB \):
\[ AB = 18 - 4 \]
\[ AB = 14 \]
Thus, the value of \( AB \) is \( \boxed{14} \).