This week's giveaway is in the Beginning Java forum.
We're giving away four copies of Bad Programming Practices 101 (e-book) and have Karl Beecher on-line!
See this thread for details.
Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how do i split this?  RSS feed

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.1.3.6.1.2.1.1.1.0: Windows samartha-81d5a0 5.1.2600 Service Pack 3 XP Professional.

The above line is the output which i'm getting. now i need to get only "windows" word from that output. how do i do that?
 
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Split by words using \s and read the second one.
 
Mohan Mehra
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

John Jai wrote:Split by words using \s and read the second one.




hey one more thing. its difficult to say that windows word comes second only. so how can i search the whole string and look for the word "windows"
 
Mohan Mehra
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got it. using contains() method. just needed the word windows. thanks for the replies
 
You guys wanna see my fabulous new place? Or do you wanna look at this tiny ad?
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!