StringSplit

 

StringSplit ÇÔ¼ö´Â ¹®ÀÚ¿­¿¡¼­ ±¸ºÐÀÚ¸¦ ±âÁØÀ¸·Î Àß¶ó¼­ ¹®ÀÚ¿­ ¹è¿­·Î ¹ÝȯÇÑ´Ù.

¹Ýȯ ½Ã ¹®ÀÚ¿­ ¹è¿­Å©±â°¡ ´Þ¶óÁö¹Ç·Î @strlen() ÇÔ¼ö·Î ¹è¿­ Å©±â¸¦ È®ÀÎÇÏ¿© ½ºÅ©¸³Æ®¸¦ ÀÛ¼ºÇØ¾ß ÇÑ´Ù.

 

string[] @StringSplit(string source, string separator);

string[] @StringSplit(string source, string separator, int options, int count;

 

ÇÔ¼öÀÎÀÚ

string source : ´ë»ó ¹®ÀÚ¿­

string separator : ±¸ºÐÀÚ

int options : ºó Ç׸ñ Á¦°Å ¿É¼Ç ( 0 - Á¦°Å ¾ÈÇÔ, 1 - Á¦°Å)

int count : ÃÖ´ë ºÐ¸® °³¼ö

 

¹Ýȯ °ª

±¸ºÐÀÚ¸¦ ±âÁØÀ¸·Î ºÐ¸®µÈ ¹®ÀÚ¿­À» ¹è¿­·Î ¹ÝȯÇÑ´Ù.

 

¿¹Á¦ 1

s = @StringSplit("aaa,bbb,ccc", ",");

 

¹®Àå¼³¸í : "aaa,bbb,ccc,ddd" ¹®ÀÚ¿­À» ÄÞ¸¶±¸ºÐÀÚ¸¦ ±âÁØÀ¸·Î ÀÚ¸¥ ¹®ÀÚ¿­À» ¹è¿­¿¡ ÀúÀåÇÑ´Ù.

                °á°ú >>  s[0] = "aaa", s[1] = "bbb", s[2] = "ccc"

 

¿¹Á¦ 2

s = @StringSplit("aaa,bbb,ccc,,eee,fff", "," , 1, 4);

 

¹®Àå¼³¸í : "aaa,bbb,ccc,,eee,fff" ¹®ÀÚ¿­À» ÄÞ¸¶±¸ºÐÀÚ¸¦ ±âÁØÀ¸·Î ÀÚ¸¥ ¹®ÀÚ¿­À» ¹è¿­¿¡ ÀúÀåÇÑ´Ù. ´Ü, ºóÇ׸ñÀº Á¦°ÅÇÏ°í, 4°³±îÁö¸¸ ºÐ¸®ÇÑ´Ù.

°á°ú : s[0] = "aaa", s[1] = "bbb", s[2] = "ccc", s[3] = "eee,fff"

 

¿¹Á¦ 3

buf = "aaa,bbb,ccc,,eee,fff"

s = @StringSplit(buf, "," , 1, 4);

$ST_0000 = s[4];  //½ºÅ©¸³Æ® ¿À·ù¹ß»ý

 

¹®Àå¼³¸í : ¹®ÀÚ¿­À» 4°³±îÁö¸¸ ºÐ¸®ÇÏ¿© s[4] ´Â À妽º ¹üÀ§¸¦ ÃÊ°úÇÏ¿© ½ºÅ©¸³Æ® ¿À·ù°¡ ¹ß»ýÇÑ´Ù.

°á°ú : s[0] = "aaa", s[1] = "bbb", s[2] = "ccc", s[3] = "eee,fff"

 

¿¹Á¦ 4

buf = "aaa,bbb,ccc,,eee,fff"

s = @StringSplit(buf, ","); //°á°ú : s[0] = "aaa", s[1] = "bbb", s[2] = "ccc", s[3] = "", s[4] = "eee", s[5] =  "fff"

length = @strlen(s);  // ¹®ÀÚ¿­ ¹è¿­ ±æÀÌÀÎ 6ÀÌ ¹ÝȯµÈ´Ù.

 

¹®Àå¼³¸í : ¹®ÀÚ¿­À» ÄÞ¸¶±¸ºÐÀÚ¸¦ ±âÁØÀ¸·Î ÀÚ¸¥ ¹®ÀÚ¿­À» ¹è¿­¿¡ ÀúÀåÇÑ´Ù.

 

 

¹öÀüÁ¤º¸

ÃÖÃÊÁö¿ø: 10.3.6.24

 

°ü·ÃÇ׸ñ

@StringIndexOf()

@StringSubstring()

@StringTrim()

@StringTrimEnd()

@StringTrimStart()

@StringUnicodeToAnsi()