Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lab3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
adil.obol
lab3
Commits
9313512e
Commit
9313512e
authored
1 year ago
by
adil.obol
Browse files
Options
Downloads
Patches
Plain Diff
Update file CmdEcho.java
parent
b935728f
Branches
main
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/no/uib/inf101/terminal/CmdEcho.java
+6
-10
6 additions, 10 deletions
src/main/java/no/uib/inf101/terminal/CmdEcho.java
with
6 additions
and
10 deletions
src/main/java/no/uib/inf101/terminal/CmdEcho.java
+
6
−
10
View file @
9313512e
...
...
@@ -3,19 +3,15 @@ package no.uib.inf101.terminal;
public
class
CmdEcho
implements
Command
{
@Override
public
String
run
(
String
[]
args
)
{
String
result
=
""
;
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
result
+=
args
[
i
];
// Add a space after each argument except the last one
if
(
i
<
args
.
length
-
1
)
{
result
+=
" "
;
}
StringBuilder
sb
=
new
StringBuilder
();
for
(
String
arg
:
args
)
{
sb
.
append
(
arg
).
append
(
" "
);
}
return
result
;
return
sb
.
toString
()
;
}
@Override
public
String
getName
()
{
return
"echo"
;
}
}
}
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment