Left Trim

From SwiftAPI

Jump to: navigation, search

Contents

C#

msdn

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

JavaScript

JavaScript 1.8.1+

Firefox 3.5+, Chrome 5+


Mozilla

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

PHP

php.net

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

Python

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

Ruby

lstrip

ruby-doc.org

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

lstrip!

ruby-doc.org

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

Visual Basic .NET

msdn

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