Groovy web console

subscribe to the feed Subscribe
to this
site

with and without slash test

Published 1 month ago by yoyoyoyoyoyo
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
with_slash = "with/slash"
without_slash = "without_slash"

String hostfile_name = with_slash.split("/").last()
String hostfile_name2 = without_slash.split("/").last()

print(hostfile_name)
print("\n")
print(hostfile_name2)