comparison dynamin/core/string.d @ 94:3b0c5c599003

Add isHighSurrogate() and isLowSurrogate().
author Jordan Miner <jminer7@gmail.com>
date Tue, 07 Jun 2011 15:41:46 -0500
parents aa4efef0f0b1
children 604d20cac836
comparison
equal deleted inserted replaced
93:8b2d3b3cbca6 94:3b0c5c599003
67 } while(num > 0); 67 } while(num > 0);
68 str.reverse; 68 str.reverse;
69 return str; 69 return str;
70 } 70 }
71 */ 71 */
72
73 // TODO: move to encoding.d
74 /**
75 * Returns true if the specified code unit is a high surrogate, in the range of 0xD800 to 0xDBFF.
76 * A high surrogate comes before a low surrogate in a surrogate pair.
77 */
78 bool isHighSurrogate(wchar c) {
79 return c >= 0xD800 && c <= 0xDBFF;
80 }
81 /**
82 * Returns true if the specified code unit is a low surrogate, in the range of 0xDC00 to 0xDFFF.
83 * A low surrogate comes after a high surrogate in a surrogate pair.
84 */
85 bool isLowSurrogate(wchar c) {
86 return c >= 0xDC00 && c <= 0xDFFF;
87 }
88
72 Layout!(char) formatter; 89 Layout!(char) formatter;
73 static this() { 90 static this() {
74 formatter = new Layout!(char); 91 formatter = new Layout!(char);
75 } 92 }
76 string format(char[] str, ...) { 93 string format(char[] str, ...) {