This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Grokking Bitcoin and have Kalle Rosenbaum on-line!
See this thread for details.
Win a copy of Grokking Bitcoin this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

How to check part of a string?  RSS feed

 
Sheriff
Posts: 5925
155
Chrome Eclipse IDE Java Postgres Database Ubuntu VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

soneand pap wrote:In Python the things are easier and i thought if i wrote it in Python I could change it back to java.  


Writing a short script is definitely easier in Python, but when you write big projects you are going to want to organize your code into classes and packages.  I'm sure Python has a way to do that, but I bet it get about as complicated as Java.

Writing in Python and converting to Java is not the way you always want do your development.  Java and Python are quite different.
 
Ranch Hand
Posts: 59
7
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Liutauras Vilda wrote:Jay Rex, when I started reading this your post, I gave you a cow, when I was near the end of reading it, I decided to give you another 2 just because how good the post was/is. And then assigned yet another cow for some other post - you were really helpful in this thread. Keep doing such a great job!


Thank you very much for all the encouragement
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to collect the second stream and store all its values in some adapted data structure.

For example using a Set:

Set<String> secondSet = second.collect(Collectors.toSet());
List<String> f = first.filter(s -> secondSet.contains(s))
                     .collect(Collectors.toList());
 
Marshal
Posts: 64131
215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
 
Bartender
Posts: 2215
92
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hemendra Singh Tnh wrote:You need to collect the second stream ...


Welcome to coderanch, I fail to see how the streams code you pasted has any context in our current discussion about splitting a mac address based on ":". Please also ensure that you quote your sources when copy-pasting content from other websites.
 
World domination requires a hollowed out volcano with good submarine access. Tiny ads are optional.
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!