Change language

PHP IntlChar :: isWhitespace () Function

|
A space character is considered an ICU space character if and only if it meets one of the following criteria:
  • This is a Unicode delimiter character (categories "Z" = "Zs" or "Zl" or " Zp "), but it is also not a non-breaking space (U + 00A0 NBSP or U + 2007, space or U + 202F Narrow NBSP).
  • U + 000A LINE FEED.
  • U + 000B VERTICAL TABLE.
  • U + 000C FORM FORM.
  • U + 000D RETURN.
  • U + 001C FILE SEPARATOR
  • U + 001D GROUP SEPARATOR.
  • U + 001E SEPARATOR ENTRY.
  • U + 001F UNIT SEPARATOR.
  • U + 0009 HORIZONTAL TABULATION.
Syntax:
bool IntlChar::isWhitespace ($codepoint)
Parameters :This function accepts a single $codepoint parameter which is required. The input parameter is a character or integer value encoded as UTF-8 string.Returned value:if $codepoint is a whiteSpace character according to ICU, then it returns True, otherwise it returns False.Below programs illustrate the IntlChar::isWhitespace()function in PHP: Program 1:
// PHP code for illustration
// IntlChar::iswhitespace() function 
// Enter capital letter var_dump (IntlChar::iswhitespace ( "R" ));  
// Enter a lowercase letter var_dump (IntlChar::iswhitespace ( "r" ));  
// Enter the Whitesapce character & quot; / n & quot; var_dump (IntlChar::iswhitespace ( "" )) ;  
// Enter the encoded string var_dump (IntlChar::iswhitespace ( "u {00A0}" ));  
// Enter a space character var_dump (IntlChar::iswhitespace ( "" ));  
?>
Exit :
bool (false) NULL bool (true) bool (false) bool (true)
Program 2:
// PHP code for IntlChar::iswhitespace()
// function 
// Declare the $arr array $arr = array ( "" , "" , "^" , " " , " G " );  
// run loop for each array element foreach ( $arr as $val ) { // Validate each element as code point data var_dump (IntlChar::iswhitespace ( $val )); }
?>
Exit :
bool (true) bool (true) bool (false) bool (true) NULL
Related Articles: Links: http://php.net/manual/en/iswhitespace

Shop

Learn programming in R: courses

$

Best Python online courses for 2022

$

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers


Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method