This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

condition using part of a URL  RSS feed

 
Al Finlay
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hi. I'm wondering if it's possible to write a condition, similar to the one above, but which evaluates to true if the first part of the URL is a match. For example, if the URL was http:\\www.greenhorn.com\thread3354 and I want to test for just http:\\www.greenhorn.com. In relation to the location property. Thanks in advance.
 
Paul Clapham
Sheriff
Posts: 22502
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean take one string and see if a second string starts with the contents of that first string? Sure, I don't see why not. The basic code is no more than 3 lines long.
 
Al Finlay
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was a bit mixed up. I didn't know if there was a property I could test or if I had to parse the string.


Thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!