Subversion Repositories jheat

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 andreas 1
package heizung;
2
 
3
public class rm_str {
4
	private String left;
5
	private String right;
6
 
7
	public rm_str()
8
	{
9
		left = "";
10
		right = "";
11
	}
12
 
13
	public String remove_string(String str, String search)
14
	{
15
		left = "";
16
		right = str;
17
 
18
		if (str.length() == 0 || search.length() == 0)
19
			return left;
20
 
21
		if (str.contains(search))
22
		{
23
		int pos;
24
 
25
			pos = str.indexOf(search);
26
			left = str.substring(0, pos + search.length());
27
			right = str.substring(left.length());
28
			return left;
29
		}
30
 
31
		return left;
32
	}
33
 
34
	public String getLeft() { return left; }
35
	public String getRight() { return right; }
36
}