Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Programming 01 Resub
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
louie.bridges
Programming 01 Resub
Commits
15b08026
Commit
15b08026
authored
Apr 04, 2019
by
louie.bridges
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update ResitCode.java
parent
668a3213
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
45 deletions
+46
-45
ResitCode.java
src/ResitCode.java
+46
-45
No files found.
src/ResitCode.java
View file @
15b08026
...
@@ -24,20 +24,21 @@ public class ResitCode {
...
@@ -24,20 +24,21 @@ public class ResitCode {
public
String
pigLatin
(
String
message
)
{
public
String
pigLatin
(
String
message
)
{
String
Newsentence
=
""
;
String
Newsentence
=
""
;
//Creates a String array
String
[]
words
;
String
[]
words
;
Newsentence
=
message
;
Newsentence
=
message
;
words
=
Newsentence
.
split
(
" "
);
words
=
Newsentence
.
split
(
" "
);
String
sentence
=
""
;
String
sentence
=
""
;
//Creates a for loop that goes through each letter in the sentance
for
(
String
letters
:
words
)
{
for
(
String
letters
:
words
)
{
sentence
+=
letters
.
substring
(
1
)
+
letters
.
substring
(
0
,
1
)
+
"ay "
;
sentence
+=
letters
.
substring
(
1
)
+
letters
.
substring
(
0
,
1
)
+
"ay "
;
}
}
//Removes the space at the end of the sentences
return
sentence
.
trim
();
return
sentence
.
trim
();
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment