Right Trim

From SwiftAPI

Jump to: navigation, search

Contents

C#

msdn

System.String : public string TrimEnd(
    params char[] trimChars
)
string a = "    Hello World    ";
string b = a.TrimEnd();
// b == "    Hello World"

JavaScript

Firefox 3.5+, Chrome 5+


Mozilla

var a = "    Hello World    ";
var b = a.trimRight();
// b == "    Hello World"

PHP

php.net

string rtrim ( string $str [, string $charlist ] )
$a = '    Hello World    ';
$b = rtrim($a);
// $b == '    Hello World'

Python

a = '    Hello World    '
b = a.rstrip()
# b == '    Hello World'

Ruby

rstrip

ruby-doc.org

a = '    Hello World    '
b = a.rstrip
# b == '    Hello World'

rstrip!

ruby-doc.org

a = '    Hello World    '
a.rstrip!
# a == '    Hello World'

Visual Basic .NET

msdn

System.String : Public Function TrimEnd ( _
    ParamArray trimChars As Char() _
) As String
Dim a As String = "    Hello World    "
Dim b As String = a.TrimEnd()
' b = "    Hello World"
Personal tools