• Post Reply Bookmark Topic Watch Topic
  • New Topic

how do i split this?  RSS feed

 
Mohan Mehra
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?
 
John Jai
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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!