I have a problem with the string manipulation. This might be a very simple question for the most of you here, however I am not familiar with java and thus I have no idea how to create the variable that I want. I hope there is someone that can help.
I have a string that always starts with 48 and then has a couple of numbers afterwards. The numbers are not always the same count, sometimes there is 5 numbers after, sometimes 10. It is the longitude of Stuttgart. To work with the data, I need to have a β.β after each 48, so that for example the string says β48.36789β or β48.345β. Is there a way to use the String Manipulation to get the results I need?
Thank you so much to anyone that can help in advance!!
you can do this with the βString Manipulationen Nodeβ
With something like this:
join(
substr($yourStringCol$, 0, 2)
,"."
,substr(
$yourStringCol$,2
,length($yourStringCol$) - 2)
)
*my first thought about just replacing β48β with β48.β will replace also die 48 in the following numbers:
But with the string replace node and a regex like
Pattern: ^([0-9]{2})
Replacement text $1.
it should work just fine
Or in your case
Pattern: ^(48)
Replacement text $1.
Great!
In case you often have to modify string or extract certain parts of strings/texts- then I would suggest to look into the regex syntax (it is easier then it looks) or check the different string manipulation functions.
Regex will solve most string related tasks (and the different string manipulation functions are often quite helpful)