FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
code-backup/5th_sem_C_Java_VB/Java/xxstring10.java at master · Jimut123/code-backup · GitHub
This repository was archived by the owner on Jul 28, 2024. It is now read-only.
Jimut123
/
code-backup
Public archive
Notifications
You must be signed in to change notification settings
Fork
6
Star
20
Code
Issues
0
Pull requests
35
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
code-backup
/
5th_sem_C_Java_VB
/
Java
/
xxstring10.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
63 lines (32 loc) · 766 Bytes
Breadcrumbs
code-backup
/
5th_sem_C_Java_VB
/
Java
/
xxstring10.java
Copy path
File metadata and controls
63 lines (32 loc) · 766 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import
java
.
io
.*;
class
xxstring10
{
public
static
void
main
(
String
args
[])
throws
IOException
{
String
s1
,
s2
;
int
i
,
n
,
m
,
count
;
BufferedReader
br
=
new
BufferedReader
(
new
InputStreamReader
(
System
.
in
));
System
.
out
.
print
(
"
\n
Enter any sentence = "
);
s1
=
br
.
readLine
();
System
.
out
.
print
(
"Enter your pattern to be searched = "
);
s2
=
br
.
readLine
();
n
=
s1
.
length
();
count
=
0
;
for
(
i
=
0
;
i
<
n
;
i
++)
{
m
=
s1
.
indexOf
(
s2
,
i
);
if
(
m
!=-
1
)
{
System
.
out
.
println
(
s2
+
" found at position = "
+
m
);
count
++;
i
=
m
;
}
else
break
;
}
if
(
count
!=
0
)
System
.
out
.
println
(
"Number of times "
+
s2
+
" found = "
+
count
);
else
System
.
out
.
println
(
s2
+
" not found"
);
}
}
Back
|
FazBrowse Home
|
New Git URL