Substring in Perl

วันจันทร์ที่ 14 กันยายน พ.ศ. 2552

Substring is Wrapping is selected from the string as desired. Use the form below.

substr (variables like Wrapping, starting position, the number you want. If not entered, it took out after the start position);

Eg.

$ a = "Welcome to Perl! \ n;

print substr ($ a, 0, 7);

# Display "Welcome".

print substr ($ a, 7);

Display # "to Perl! \ N".

print substr ($ a, -6, 4);

# Display "Perl" (-6 means that much from his last position 6).

0 ความคิดเห็น:

แสดงความคิดเห็น

 
 
 
 
Copyright © Basic Perl