从C#转换为VB.net的粗体行中存在问题 [英] There is problem in the Bold lines it is converted from c# to VB.net
本文介绍了从C#转换为VB.net的粗体行中存在问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Private Shared Function ResolveCharacterSound(ByVal c As Char) As String
Dim str As String = "" & c
Dim totalCoreSoundCharacter As Integer = 0
If isPunct(c) Then
Return str
ElseIf isDigit(c) Then
Return "" & CChar("०") ("०"c + (c - "0"c))
ElseIf isConsonent(str(0), False) Then
Return "" & GetCoreSound(str, totalCoreSoundCharacter) & "्"
Else
Return "" & GetCoreSound(str, totalCoreSoundCharacter)
End If
End Function
******************************************************
*************************************************
Public Shared Function DoTransLitrate(ByVal str As String) As String
Dim i As Integer = 0
Dim ret As String = ""
Dim pi As Integer = 0
Dim vowelFlag As Boolean = False
str = str.ToLower()
While i < str.Length
Try
If (str(i) = "h"c AndAlso vowelFlag) OrElse (isConsonent(str(i), vowelFlag) AndAlso i > 0) OrElse (str(i) = " "c) OrElse isPunct(str(i)) OrElse isDigit(str(i)) OrElse ((i - pi) > 5) Then
If pi < i Then
ret += GetSound(str.Substring(pi, i - pi))
End If
If str(i) = " "c Then
ret += " "c
End If
If ((str(i) = " "c) OrElse isPunct(str(i))) Then
ret += str(i)
pi = i + 1
ElseIf isDigit(str(i)) Then
Dim digi As String = "" & CChar("०") c + (str(i) - "0"c))
ret += digi
pi = i + 1
Else
pi = i
End If
vowelFlag = False
ElseIf isVowel(str(i)) AndAlso str(i) <> "h"c Then
vowelFlag = True
End If
i += 1
Catch exp As Exception
ret += "error!!"
End Try
End While
If pi < i Then
Try
ret += GetSound(str.Substring(pi, i - pi))
Catch exp As Exception
ret += "error!!"
End Try
End If
Return SuperTrim(ret)
End Function
推荐答案
从技术上讲,这是重新发布 [ ^ ].从上一个问题答案中获取提示,然后尝试一下.
此外,您只需要在代码行和有关详细信息的周围而不是整个代码就可以得到答案.
查看此图表并根据需要使用它: VB.NET和C#比较 [ ^ ]
Technically it is a repost[^]. Take hints from the previous question answer you had and try out.
Further, all you need is to give the code line and around about details instead of whole code to get an answer.
Have a look at this chart and use it as per need: VB.NET and C# Comparison[^]
可以更新原始文件吗? C#的源代码以了解更多信息.
谢谢.
can you update original a source code of c# to understand more.
Thank you.
这篇关于从C#转换为VB.net的粗体行中存在问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文