PageRenderTime 27ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/src/Libraries/CoreLib/String.cs

https://github.com/kripa82/scriptsharp
C# | 412 lines | 258 code | 83 blank | 71 comment | 0 complexity | d7053ab2cb4145fbe70527a59a1d2331 MD5 | raw file
  1. // String.cs
  2. // Script#/Libraries/CoreLib
  3. // Copyright (c) Nikhil Kothari.
  4. // Copyright (c) Microsoft Corporation.
  5. // This source code is subject to terms and conditions of the Microsoft
  6. // Public License. A copy of the license can be found in License.txt.
  7. //
  8. using System.ComponentModel;
  9. using System.Runtime.CompilerServices;
  10. namespace System {
  11. /// <summary>
  12. /// Equivalent to the String type in Javascript.
  13. /// </summary>
  14. [IgnoreNamespace]
  15. [Imported]
  16. public sealed class String {
  17. /// <summary>
  18. /// An empty zero-length string.
  19. /// </summary>
  20. [PreserveCase]
  21. public static readonly String Empty = "";
  22. /// <summary>
  23. /// The number of characters in the string.
  24. /// </summary>
  25. [IntrinsicProperty]
  26. public int Length {
  27. get {
  28. return 0;
  29. }
  30. }
  31. /// <summary>
  32. /// Retrieves the character at the specified position.
  33. /// </summary>
  34. /// <param name="index">The specified 0-based position.</param>
  35. /// <returns>The character within the string.</returns>
  36. public char CharAt(int index) {
  37. return '\0';
  38. }
  39. /// <summary>
  40. /// Retrieves the character code of the character at the specified position.
  41. /// </summary>
  42. /// <param name="index">The specified 0-based position.</param>
  43. /// <returns>The character code of the character within the string.</returns>
  44. public int CharCodeAt(int index) {
  45. return 0;
  46. }
  47. public static int Compare(string s1, string s2) {
  48. return 0;
  49. }
  50. public static int Compare(string s1, string s2, bool ignoreCase) {
  51. return 0;
  52. }
  53. public int CompareTo(string s) {
  54. return 0;
  55. }
  56. public int CompareTo(string s, bool ignoreCase) {
  57. return 0;
  58. }
  59. public static string Concat(string s1, string s2) {
  60. return null;
  61. }
  62. public static string Concat(string s1, string s2, string s3) {
  63. return null;
  64. }
  65. public static string Concat(string s1, string s2, string s3, string s4) {
  66. return null;
  67. }
  68. /// <summary>
  69. /// Concatenates a set of individual strings into a single string.
  70. /// </summary>
  71. /// <param name="strings">The sequence of strings</param>
  72. /// <returns>The concatenated string.</returns>
  73. public static string Concat(params string[] strings) {
  74. return null;
  75. }
  76. [EditorBrowsable(EditorBrowsableState.Never)]
  77. public static string Concat(object o1, object o2) {
  78. return null;
  79. }
  80. [EditorBrowsable(EditorBrowsableState.Never)]
  81. public static string Concat(object o1, object o2, object o3) {
  82. return null;
  83. }
  84. [EditorBrowsable(EditorBrowsableState.Never)]
  85. public static string Concat(object o1, object o2, object o3, object o4) {
  86. return null;
  87. }
  88. [EditorBrowsable(EditorBrowsableState.Never)]
  89. public static string Concat(params object[] o) {
  90. return null;
  91. }
  92. /// <summary>
  93. /// Returns the unencoded version of a complete encoded URI.
  94. /// </summary>
  95. /// <returns>The unencoded string.</returns>
  96. [ScriptName("decodeURI")]
  97. public string DecodeUri() {
  98. return null;
  99. }
  100. /// <summary>
  101. /// Returns the unencoded version of a single part or component of an encoded URI.
  102. /// </summary>
  103. /// <returns>The unencoded string.</returns>
  104. [ScriptName("decodeURIComponent")]
  105. public string DecodeUriComponent() {
  106. return null;
  107. }
  108. /// <summary>
  109. /// Encodes the complete URI.
  110. /// </summary>
  111. /// <returns>The encoded string.</returns>
  112. [ScriptName("encodeURI")]
  113. public string EncodeUri() {
  114. return null;
  115. }
  116. /// <summary>
  117. /// Encodes a single part or component of a URI.
  118. /// </summary>
  119. /// <returns>The encoded string.</returns>
  120. [ScriptName("encodeURIComponent")]
  121. public string EncodeUriComponent() {
  122. return null;
  123. }
  124. /// <summary>
  125. /// Determines if the string ends with the specified character.
  126. /// </summary>
  127. /// <param name="ch">The character to test for.</param>
  128. /// <returns>true if the string ends with the character; false otherwise.</returns>
  129. public bool EndsWith(char ch) {
  130. return false;
  131. }
  132. /// <summary>
  133. /// Determines if the string ends with the specified substring or suffix.
  134. /// </summary>
  135. /// <param name="suffix">The string to test for.</param>
  136. /// <returns>true if the string ends with the suffix; false otherwise.</returns>
  137. public bool EndsWith(string suffix) {
  138. return false;
  139. }
  140. /// <summary>
  141. /// Determines if the strings are equal.
  142. /// </summary>
  143. /// <returns>true if the string s1 = s2; false otherwise.</returns>
  144. public static bool Equals(string s1, string s2, bool ignoreCase) {
  145. return false;
  146. }
  147. /// <summary>
  148. /// Encodes a string by replacing punctuation, spaces etc. with their escaped equivalents.
  149. /// </summary>
  150. /// <returns>The escaped string.</returns>
  151. public string Escape() {
  152. return null;
  153. }
  154. public static string Format(string format, params object[] values) {
  155. return null;
  156. }
  157. public static string FromChar(char ch, int count) {
  158. return null;
  159. }
  160. public static string FromCharCode(params int[] charCodes) {
  161. return null;
  162. }
  163. public string HtmlDecode() {
  164. return null;
  165. }
  166. public string HtmlEncode() {
  167. return null;
  168. }
  169. public int IndexOf(char ch) {
  170. return 0;
  171. }
  172. public int IndexOf(string subString) {
  173. return 0;
  174. }
  175. public int IndexOf(char ch, int startIndex) {
  176. return 0;
  177. }
  178. public int IndexOf(string subString, int startIndex) {
  179. return 0;
  180. }
  181. public int IndexOfAny(char[] ch) {
  182. return 0;
  183. }
  184. public int IndexOfAny(char[] ch, int startIndex) {
  185. return 0;
  186. }
  187. public int IndexOfAny(char[] ch, int startIndex, int count) {
  188. return 0;
  189. }
  190. public string Insert(int index, string value) {
  191. return null;
  192. }
  193. public static bool IsNullOrEmpty(string s) {
  194. return false;
  195. }
  196. public int LastIndexOf(Char ch) {
  197. return 0;
  198. }
  199. public int LastIndexOf(string subString) {
  200. return 0;
  201. }
  202. public int LastIndexOf(char ch, int startIndex) {
  203. return 0;
  204. }
  205. public int LastIndexOf(string subString, int startIndex) {
  206. return 0;
  207. }
  208. public int LastIndexOfAny(char[] ch) {
  209. return 0;
  210. }
  211. public int LastIndexOfAny(char[] ch, int startIndex) {
  212. return 0;
  213. }
  214. public int LastIndexOfAny(char[] ch, int startIndex, int count) {
  215. return 0;
  216. }
  217. public int LocaleCompare(string string2) {
  218. return 0;
  219. }
  220. public static string LocaleFormat(string format, params object[] values) {
  221. return null;
  222. }
  223. public string[] Match(RegularExpression regex) {
  224. return null;
  225. }
  226. public string PadLeft(int totalWidth) {
  227. return null;
  228. }
  229. public string PadLeft(int totalWidth, char ch) {
  230. return null;
  231. }
  232. public string PadRight(int totalWidth) {
  233. return null;
  234. }
  235. public string PadRight(int totalWidth, char ch) {
  236. return null;
  237. }
  238. public string Remove(int index) {
  239. return null;
  240. }
  241. public string Remove(int index, int count) {
  242. return null;
  243. }
  244. public string Replace(string oldText, string replaceText) {
  245. return null;
  246. }
  247. public string ReplaceFirst(string oldText, string replaceText) {
  248. return null;
  249. }
  250. public string ReplaceRegex(RegularExpression regex, string replaceText) {
  251. return null;
  252. }
  253. public string ReplaceRegex(RegularExpression regex, StringReplaceCallback callback) {
  254. return null;
  255. }
  256. public int Search(RegularExpression regex) {
  257. return 0;
  258. }
  259. public string[] Split(char ch) {
  260. return null;
  261. }
  262. public string[] Split(string separator) {
  263. return null;
  264. }
  265. public string[] Split(char ch, int limit) {
  266. return null;
  267. }
  268. public string[] Split(string separator, int limit) {
  269. return null;
  270. }
  271. public string[] Split(RegularExpression regex) {
  272. return null;
  273. }
  274. public string[] Split(RegularExpression regex, int limit) {
  275. return null;
  276. }
  277. public bool StartsWith(char ch) {
  278. return false;
  279. }
  280. public bool StartsWith(string prefix) {
  281. return false;
  282. }
  283. public string Substr(int startIndex) {
  284. return null;
  285. }
  286. public string Substr(int startIndex, int length) {
  287. return null;
  288. }
  289. public string Substring(int startIndex, int endIndex) {
  290. return null;
  291. }
  292. public string ToLocaleLowerCase() {
  293. return null;
  294. }
  295. public string ToLocaleUpperCase() {
  296. return null;
  297. }
  298. public string ToLowerCase() {
  299. return null;
  300. }
  301. public string ToUpperCase() {
  302. return null;
  303. }
  304. public string Trim() {
  305. return null;
  306. }
  307. public string TrimStart() {
  308. return null;
  309. }
  310. public string TrimEnd() {
  311. return null;
  312. }
  313. /// <summary>
  314. /// Decodes a string by replacing escaped parts with their equivalent textual representation.
  315. /// </summary>
  316. /// <returns>The unescaped string.</returns>
  317. public string Unescape() {
  318. return null;
  319. }
  320. /// <internalonly />
  321. public static bool operator ==(string s1, string s2) {
  322. return false;
  323. }
  324. /// <internalonly />
  325. public static bool operator !=(string s1, string s2) {
  326. return false;
  327. }
  328. }
  329. }