5
Answers

Search In TreeView when SearchValue has space in between

fuad pulpadan

fuad pulpadan

12y
1.9k
1
Dear all,

   I am creating an application with VB.Net.In my application i am using a treeview and nodes are loading from database.All nodes are parent and no child.My problem is how we can search node if node value has space in between?My node values are like DF 4562,OP 2514,DF 1125,DF 6895 etc.In normal case we can search values easily by clicking value in keyboard if is don't have space.Please help me
Answers (5)
0
Vulpes
NA 98.3k 1.5m 12y
Try this:

import java.io.*;
import java.util.*;

public class Catalin
{
   public static void main(String[] args)
   {
       ArrayList<Integer> sumsList = new ArrayList<Integer>();

       try
       {
          BufferedReader br = new BufferedReader(new FileReader("catalin.txt"));
          String line;

          while ((line = br.readLine()) != null) 
          {
             String[] items = line.split(";");
             int number = Integer.parseInt(items[1]);
             int number2 = Integer.parseInt(items[2]);
             sumsList.add(number + number2);
          }

          br.close();
       }
       catch(IOException e)
       {
          System.out.println("I/O Error : " + e);
       }
       
       // convert ArrayList<Integer> to int[]
       int[] sumsArray = new int[sumsList.size()];
       for(int i = 0; i < sumsArray.length; i++) sumsArray[i] = sumsList.get(i);

       System.out.println("Line Sum");
       System.out.println("---- ---");

       for(int i = 0; i < sumsArray.length; i++)
       { 
          System.out.println((i + 1) + "     " + sumsArray[i]);
       }
   }
}