Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

transformquestionmarks=OCR

function getAllQuestionMarks(s){
  let digits = 0;
  let result = '';
  for(let i = 0; i < s.length; i++){
    const letter = s.charAt(i);

    if(/[0-9]/.test(letter)){
      digits = digits * 10 + parseInt(letter, 10);
    }else{
      if(digits > 0){
        let marks = '';
        for(let j = 0; j < digits; j++){
          marks += '?';
        }
        result += marks;
        digits = 0;
      }

      result += letter;
    }
  }
  return result;
}

console.log(getAllQuestionMarks('A12Le')); // A????????????Le
console.log(getAllQuestionMarks('A2Le'));  // A??Le
console.log(getAllQuestionMarks('2PLe'));  // ??PLe
Comment

PREVIOUS NEXT
Code Example
Csharp :: in model add to give drop down message 
Csharp :: asp.net render control to string 
Csharp :: use & symbole in xml as a text using c# 
Csharp :: how to make dobuble jump unity 2d 
Csharp :: ef core identity get user with relationships 
Csharp :: cs foreach int 
Csharp :: c# place all keys in dictionary into array 
Csharp :: hdrp lit change emmision values 
Csharp :: blazor OnInitializedAsync Unhandled exception rendering component: Cannot wait on monitors on this runtime. 
Csharp :: convert bool to uint in solidity 
Csharp :: c# run foreach loop x times 
Csharp :: source a listbox by property of object c# 
Csharp :: most popular products code using asp.net core in visual studio code 
Csharp :: C# write to lines without extra line 
Csharp :: unity3d spin wheel 
Csharp :: boucle C# 
Csharp :: bitter foods examplews 
Csharp :: C# Printing Variables and Literals using WriteLine() and Write() 
Csharp :: c# get count from unknown list 
Csharp :: obs mfplat.dll 
Csharp :: add numbers c# 
Csharp :: c# windows form BalloonTipIcon close 
Csharp :: vb.net tostring numeric format string 
Csharp :: unity bool to int 
Csharp :: unity pause 
Csharp :: convert array to list c# 
Csharp :: is c# hard to learn 
Csharp :: c# jump space 
Csharp :: .net directorysearcher get manager accountname 
Html :: how to link css to html 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =