Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 932a8c6

Browse files
committed
Add solution for Remove Trailing Zeros From a String problem
1 parent 4c24bb6 commit 932a8c6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
class Solution
3+
{
4+
/**
5+
* @param String $num
6+
* @return String
7+
*/
8+
public function removeTrailingZeros($num)
9+
{
10+
return rtrim($num, '0');
11+
}
12+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /