using UnityEngine;
using System.Collections;
public class ExPars : MonoBehaviour {
// Use this for initialization
void Start () {
string s = "HELLO WORLD";
string re = SubString(s, 6, 3, 'Q');
print (re);
}
string SubString(string s, int pos, int count, char ch) {
string result = "";
for(int i = 0; i < pos; i++){
result += s[i];
}
for(int i = pos; i < pos + count; i++){
result += ch;
}
for(int i = pos+count; i < s.Length; i++){
result += s[i];
}
return result;
}
// Update is called once per frame
void Update () {
}
}
'Computer Language > 유니티' 카테고리의 다른 글
String.Format 잘 봐두자 유용하게 쓰인다. (0) | 2014.04.21 |
---|---|
포맷 형식 (0) | 2014.04.21 |
letter (0) | 2014.04.15 |
이동과 크기. (0) | 2014.04.14 |
아이템 배열 Out 을 참조 (0) | 2014.04.14 |