check if first value of a string is different to the second value java
<p>I have an app which returns the road that somebody is on and I would like to find out whether they are on a different road to the one they started on.</p>

<p>For example, I have</p>

<pre><code>userLoc = address.getThoroughfare();
</code></pre>

<p>which gets their location and stores it, I would like to store that as a string to something like <code>String firstLoc</code> and then <code>if(userLoc.equals(firstLoc))</code> </p>

<p>Sorry if I was not clear enough, I am asking how to set a String to the first value of <code>userLoc</code>, so I may check it against in the future.</p>
