当前位置:网站首页>Unity sends messages and blocks indecent words
Unity sends messages and blocks indecent words
2022-07-05 04:55:00 【yaohuiyaoo】
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Test : MonoBehaviour {
Text text;
Button btn;
InputField inout;
string temp;
void Start () {
temp = null;
text = transform.GetChild(0).GetComponent
btn = transform.GetChild(1).GetComponent();
inout = transform.GetChild(2).GetComponent();
btn.onClick.AddListener(Send);
}
string mm;
void Send()
{
string s =inout.text;
List list = new List();
list.Add(“ Bad guys ”);
list.Add(“ A fool ”);
for(int i = 0; i < list.Count; i++)
{
for (int j = 0; j< s.Length; j++)
{
temp = temp + s[j];
//print(temp);
for (int z =j+1; z < s.Length; z++)
{
temp = temp+s[z];
print(temp);
if (temp.Equals(list[i]))
{
int y = z - j;
mm= s.Replace(temp,Change(y));
break;
}
}
temp = null;
}
}
text.text = mm;
}
private string Change(int y)
{
string s = null;
for (int i = 0; i <=y; i++)
{
s = s + "*";
}
return s;
}
边栏推荐
- 775 Div.1 B. integral array mathematics
- CUDA Programming atomic operation atomicadd reports error err:msb3721, return code 1
- Database under unity
- 3dsmax snaps to frozen objects
- Group counting notes (1) - check code, original complement multiplication and division calculation, floating point calculation
- Unity parallax infinite scrolling background
- JVM 原理和流程简介
- Emlog博客主题模板源码简约好看响应式
- Common technologies of unity
- Panel panel of UI
猜你喜欢
2022 U.S. college students' mathematical modeling e problem ideas / 2022 U.S. game e problem analysis
[goweb development] Introduction to authentication modes based on cookies, sessions and JWT tokens
Reading and visualization of DICOM, MHD and raw files in medical imaging
【acwing】528. cheese
Autocad-- dynamic zoom
2022 thinking of Mathematical Modeling B problem of American college students / analysis of 2022 American competition B problem
Flutter 小技巧之 ListView 和 PageView 的各种花式嵌套
【acwing】837. Number of connected block points
[AI bulletin 20220211] the hard core up owner has built a lidar and detailed AI accelerator
On-off and on-off of quality system construction
随机推荐
Group counting notes (1) - check code, original complement multiplication and division calculation, floating point calculation
MD5绕过
Debug insights
Chapter 6 text processing tools for shell programming (awk)
Introduce Hamming distance and calculation examples
Common technologies of unity
Manually implement heap sorting -838 Heap sort
3dsmax scanning function point connection drawing connection line
Mode in BST (binary tree & Notes on question brushing)
C iterator
Leetcode 222 number of nodes of complete binary tree
【Leetcode】1352. 最后 K 个数的乘积
jmeter -- 分布式压测
【acwing】837. Number of connected block points
669. 修剪二叉搜索树 ●●
[Business Research Report] top ten trends of science and technology and it in 2022 - with download link
AutoCAD - isometric annotation
[groovy] closure (closure call | closure default parameter it | code example)
mysql審計日志歸檔
[crampon programming] lintcode decoding Encyclopedia - 1100 strange printer